aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.selectable.js
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2008-11-21 04:01:33 +0000
committerRichard Worth <rdworth@gmail.com>2008-11-21 04:01:33 +0000
commitfb94a4e34e25941443bdd7c52c41844e29f2db9f (patch)
treeb54be3ceb6429136d862abc5cd9dd8310a4fc25b /ui/ui.selectable.js
parent2192c024e2b8dd4b3a27170400107400dc5a72b4 (diff)
downloadjquery-ui-fb94a4e34e25941443bdd7c52c41844e29f2db9f.tar.gz
jquery-ui-fb94a4e34e25941443bdd7c52c41844e29f2db9f.zip
draggable, droppable, resizable, selectable, sortable: formatting changes - moved some things around for consistency.
_init and destroy at the top, then _mouse methods. plugins, ui last. Sorted defaults and plugins alphabetically.
Diffstat (limited to 'ui/ui.selectable.js')
-rw-r--r--ui/ui.selectable.js27
1 files changed, 17 insertions, 10 deletions
diff --git a/ui/ui.selectable.js b/ui/ui.selectable.js
index 631289fd3..6c20692e8 100644
--- a/ui/ui.selectable.js
+++ b/ui/ui.selectable.js
@@ -13,6 +13,7 @@
(function($) {
$.widget("ui.selectable", $.extend({}, $.ui.mouse, {
+
_init: function() {
var self = this;
@@ -51,13 +52,7 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
.css({border:'1px dotted black'})
.addClass("ui-selectable-helper");
},
- toggle: function() {
- if(this.options.disabled){
- this.enable();
- } else {
- this.disable();
- }
- },
+
destroy: function() {
this.element
.removeClass("ui-selectable ui-selectable-disabled")
@@ -65,6 +60,7 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
.unbind(".selectable");
this._mouseDestroy();
},
+
_mouseStart: function(event) {
var self = this;
@@ -121,6 +117,7 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
});
return this.options.keyboard ? !isSelectee : true;
},
+
_mouseDrag: function(event) {
var self = this;
this.dragged = true;
@@ -210,6 +207,7 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
return false;
},
+
_mouseStop: function(event) {
var self = this;
@@ -248,17 +246,26 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
this.helper.remove();
return false;
+ },
+
+ toggle: function() {
+ if(this.options.disabled){
+ this.enable();
+ } else {
+ this.disable();
+ }
}
+
}));
$.extend($.ui.selectable, {
version: "@VERSION",
defaults: {
- distance: 1,
- delay: 0,
- cancel: ":input",
appendTo: 'body',
autoRefresh: true,
+ cancel: ":input",
+ delay: 0,
+ distance: 1,
filter: '*',
tolerance: 'touch'
}