Mercurial > hg > dml-open-vis
diff src/DML/MainVisBundle/Resources/assets/lib/jquery.eventsugar/jquery.eventsugar.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/jquery.eventsugar/jquery.eventsugar.js Tue Feb 09 20:54:02 2016 +0100 @@ -0,0 +1,16 @@ +/** + * Contains some boilerplate code for event handling + * + */ +(function($) { + $.eventsugar = { + /** + * Checks if a click is an attempt to open a link in a new tab + * @param event + * @returns {Boolean} + */ + isAttemptToOpenInAnotherWindow: function(event) { + return 2 === event.which || event.metaKey || event.ctrlKey || event.shiftKey; + } + }; +})(jQuery); \ No newline at end of file