annotate src/DML/MainVisBundle/Resources/assets/lib/underscore.mixins/underscore.isEventAnAttemptToOpenANewTab.js @ 0:493bcb69166c

added public content
author Daniel Wolff
date Tue, 09 Feb 2016 20:54:02 +0100
parents
children
rev   line source
Daniel@0 1 /**
Daniel@0 2 * Changes the default functionality of _.uniqueId()
Daniel@0 3 *
Daniel@0 4 * Adds a new function _.markUniqueIdAsAlreadyUsed
Daniel@0 5 *
Daniel@0 6 * Quicker alternative to
Daniel@0 7 * _.isObject(serializedAttributes) && !_.isArray(serializedAttributes) && !_.isFunction(serializedAttributes)
Daniel@0 8 *
Daniel@0 9 * @memberOf _
Daniel@0 10 */
Daniel@0 11 var toString = Object.prototype.toString;
Daniel@0 12 if (_) {
Daniel@0 13 _.mixin({
Daniel@0 14 isEventAnAttemptToOpenANewTab: function(event) {
Daniel@0 15 return event.ctrlKey || event.shiftKey || event.metaKey || event.which == 2;
Daniel@0 16 }
Daniel@0 17 });
Daniel@0 18 } else {
Daniel@0 19 console.error("Can't register _.isClickAnAttemptToOpenANewTab without underscore.js (global variable '_')");
Daniel@0 20 }