diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/DML/MainVisBundle/Resources/assets/lib/underscore.mixins/underscore.isEventAnAttemptToOpenANewTab.js	Tue Feb 09 20:54:02 2016 +0100
@@ -0,0 +1,20 @@
+/**
+ * Changes the default functionality of _.uniqueId()
+ *
+ * Adds a new function _.markUniqueIdAsAlreadyUsed
+ *
+ * Quicker alternative to
+ *  _.isObject(serializedAttributes) && !_.isArray(serializedAttributes)  && !_.isFunction(serializedAttributes)
+ *
+ * @memberOf _
+ */
+var toString = Object.prototype.toString;
+if (_) {
+    _.mixin({
+        isEventAnAttemptToOpenANewTab: function(event) {
+            return event.ctrlKey || event.shiftKey || event.metaKey || event.which == 2;
+        }
+    });
+} else {
+    console.error("Can't register _.isClickAnAttemptToOpenANewTab without underscore.js (global variable '_')");
+}