avoid opening of modal window on modifier+click

pull/6827/head
Gregor Schmidt 13 years ago
parent 29be4e4ed6
commit 0392d951ce
  1. 16
      assets/javascripts/app/modal.js
  2. 7
      assets/javascripts/lib/livepipe-ui/window.js

@ -1,5 +1,5 @@
/*jslint indent: 2, regexp: false */
/*globals $, Control, Element, Class, window, setTimeout */
/*globals $, Control, Element, Class, Event, window, setTimeout */
/*globals console */
var Backlogs = (function () {
var Modal, ModalLink, width;
@ -21,6 +21,20 @@ var Backlogs = (function () {
$super(container, Object.extend(Object.clone(Modal.defaultOptions), options || {}));
},
open : function ($super, event) {
if (event) {
// catches middle clicks
if (!Event.isLeftClick(event)) {
return true;
}
// catches modifier keys
if (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {
return true;
}
}
return $super(event);
},
position : function ($super, event) {
$super(event);
this.fixPosition();

@ -192,9 +192,10 @@ Control.Window = Class.create({
}
//hover or click handling
this.sourceContainerOpenHandler = function(event){
this.open(event);
event.stop();
return false;
if (this.open(event) === false) {
event.stop();
return false;
}
}.bindAsEventListener(this);
this.sourceContainerCloseHandler = function(event){
this.close(event);

Loading…
Cancel
Save