resizable,selectable,slider: changed this.disabled to this.options.disabled (fixes #2552)

This commit is contained in:
Paul Bakaus 2008-05-25 14:24:02 +00:00
parent a4aa144c3b
commit 620ed33295
3 changed files with 13 additions and 13 deletions

View File

@ -251,14 +251,14 @@
}, },
enable: function() { enable: function() {
this.element.removeClass("ui-resizable-disabled"); this.element.removeClass("ui-resizable-disabled");
this.disabled = false; this.options.disabled = false;
}, },
disable: function() { disable: function() {
this.element.addClass("ui-resizable-disabled"); this.element.addClass("ui-resizable-disabled");
this.disabled = true; this.options.disabled = true;
}, },
mouseStart: function(e) { mouseStart: function(e) {
if(this.disabled) return false; if(this.options.disabled) return false;
var handle = false; var handle = false;
for(var i in this.options.handles) { for(var i in this.options.handles) {

View File

@ -52,7 +52,7 @@
this.helper = $(document.createElement('div')).css({border:'1px dotted black'}); this.helper = $(document.createElement('div')).css({border:'1px dotted black'});
}, },
toggle: function() { toggle: function() {
if(this.disabled){ if(this.options.disabled){
this.enable(); this.enable();
} else { } else {
this.disable(); this.disable();
@ -67,18 +67,18 @@
}, },
enable: function() { enable: function() {
this.element.removeClass("ui-selectable-disabled"); this.element.removeClass("ui-selectable-disabled");
this.disabled = false; this.options.disabled = false;
}, },
disable: function() { disable: function() {
this.element.addClass("ui-selectable-disabled"); this.element.addClass("ui-selectable-disabled");
this.disabled = true; this.options.disabled = true;
}, },
mouseStart: function(e) { mouseStart: function(e) {
var self = this; var self = this;
this.opos = [e.pageX, e.pageY]; this.opos = [e.pageX, e.pageY];
if (this.disabled) if (this.options.disabled)
return; return;
var options = this.options; var options = this.options;
@ -133,7 +133,7 @@
var self = this; var self = this;
this.dragged = true; this.dragged = true;
if (this.disabled) if (this.options.disabled)
return; return;
var options = this.options; var options = this.options;

View File

@ -49,11 +49,11 @@
}, },
enable: function() { enable: function() {
this.element.removeClass("ui-slider-disabled"); this.element.removeClass("ui-slider-disabled");
this.disabled = false; this.options.disabled = false;
}, },
disable: function() { disable: function() {
this.element.addClass("ui-slider-disabled"); this.element.addClass("ui-slider-disabled");
this.disabled = true; this.options.disabled = true;
}, },
setData: function(key, value) { setData: function(key, value) {
this.options[key] = value; this.options[key] = value;
@ -162,7 +162,7 @@
if(this == e.target) if(this == e.target)
clickedHandle = true; clickedHandle = true;
}); });
if (clickedHandle || this.disabled || !(this.currentHandle || this.previousHandle)) if (clickedHandle || this.options.disabled || !(this.currentHandle || this.previousHandle))
return; return;
// If a previous handle was focussed, focus it again // If a previous handle was focussed, focus it again
@ -270,10 +270,10 @@
this.propagate('start', e); this.propagate('start', e);
if(!this.disabled) { if(!this.options.disabled) {
if(this.currentHandle) this.blur(this.currentHandle); if(this.currentHandle) this.blur(this.currentHandle);
this.focus(handle,1); this.focus(handle,1);
return !this.disabled; return !this.options.disabled;
} }
}, },
mouseDrag: function(e) { mouseDrag: function(e) {