var self = this,
btnIsLeft = (e.which == 1),
elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).is(this.options.cancel) : false);
- if (!btnIsLeft || elIsCancel) {
+ if (!btnIsLeft || elIsCancel || !this.mouseCapture(e)) {
return true;
}
// These are placeholder methods, to be overriden by extending plugin
mouseStart: function(e) {},
mouseDrag: function(e) {},
- mouseStop: function(e) {}
+ mouseStop: function(e) {},
+ mouseCapture: function(e) { return true; }
};
$.ui.mouse.defaults = {
this.instance.options.helper = function() { return ui.helper[0]; };
e.target = this.instance.currentItem[0];
+ this.instance.mouseCapture(e, true, true);
this.instance.mouseStart(e, true, true);
//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
};
},
- mouseStart: function(e, overrideHandle, noActivation) {
-
- var o = this.options;
- this.currentContainer = this;
+ mouseCapture: function(e, overrideHandle) {
if(this.options.disabled || this.options.type == 'static') return false;
}
this.currentItem = currentItem;
+ return true;
+
+ },
+ mouseStart: function(e, overrideHandle, noActivation) {
+
+ var o = this.options;
+ this.currentContainer = this;
this.refresh();