r3150 committed - selectable dev: selectable can now be properly disabled
Revision: 3150
Author: paul.bakaus
Date: Thu Aug 27 07:31:09 2009
Log: selectable dev: selectable can now be properly disabled
http://code.google.com/p/jquery-ui/source/detail?r=3150
Modified:
/branches/dev/selectable/ui/ui.selectable.js
=======================================
--- /branches/dev/selectable/ui/ui.selectable.js Thu Aug 27 07:14:03 2009
+++ /branches/dev/selectable/ui/ui.selectable.js Thu Aug 27 07:31:09 2009
@@ -43,6 +43,9 @@
this.element
.bind('mousedown.selectable', function(event) {
+ if(self.options.disabled)
+ return;
+
var item = self._targetIsItem(event.target);
if (!item) return;
@@ -77,14 +80,14 @@
}
})
.bind('focus.selectable', function() {
- self.currentFocus.addClass('ui-state-focus');
+ if(!self.options.disabled)
self.currentFocus.addClass('ui-state-focus');
})
.bind('blur.selectable', function() {
- self.currentFocus.removeClass('ui-state-focus');
+ if(!self.options.disabled)
self.currentFocus.removeClass('ui-state-focus');
})
.bind('keydown.selectable', function(event) {
- if(!self.options.keyboard)
+ if(!self.options.keyboard || self.options.disabled)
return;
if(self._trigger('beforeselect', event) === false)