var $ = require('jquery'); /** * Check if Linux user used right/middle click at the time of the event * * @param ev {Event} * @returns {boolean} */ function isLinuxMiddleOrRightClick (ev) { return ev.which === 2 || ev.which === 3; } /** * Check if Mac user used CMD key at the time of the event Mac user used CMD key at the time of the event. * * @param ev {Event} * @returns {boolean} */ function isMacCmdKeyPressed (ev) { return ev.metaKey; } function isCtrlKeyPressed (ev) { return ev.ctrlKey; } /** * Click handler for a cartodb.js view, to navigate event target's href URL through the view's router.navigate method. * * The default behavior is: * Unless cmd/ctrl keys are pressed it will cancel the default link behavior and instead navigate to the URL set in the * target's href attribute. * * Prerequisities: * - view has a this.router instance. * * Example of how to use: * - In a template: *