Upgrade jQuery UI from 1.8.24 to 1.9.2
[lhc/web/wiklou.git] / resources / lib / jquery.ui / jquery.ui.selectable.js
index 44c6e8c..3f27b73 100644 (file)
@@ -1,11 +1,12 @@
 /*!
- * jQuery UI Selectable 1.8.24
+ * jQuery UI Selectable 1.9.2
+ * http://jqueryui.com
  *
- * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license.
  * http://jquery.org/license
  *
- * http://docs.jquery.com/UI/Selectables
+ * http://api.jqueryui.com/selectable/
  *
  * Depends:
  *     jquery.ui.core.js
@@ -15,6 +16,7 @@
 (function( $, undefined ) {
 
 $.widget("ui.selectable", $.ui.mouse, {
+       version: "1.9.2",
        options: {
                appendTo: 'body',
                autoRefresh: true,
@@ -23,7 +25,7 @@ $.widget("ui.selectable", $.ui.mouse, {
                tolerance: 'touch'
        },
        _create: function() {
-               var self = this;
+               var that = this;
 
                this.element.addClass("ui-selectable");
 
@@ -32,7 +34,7 @@ $.widget("ui.selectable", $.ui.mouse, {
                // cache selectee children based on filter
                var selectees;
                this.refresh = function() {
-                       selectees = $(self.options.filter, self.element[0]);
+                       selectees = $(that.options.filter, that.element[0]);
                        selectees.addClass("ui-selectee");
                        selectees.each(function() {
                                var $this = $(this);
@@ -60,21 +62,17 @@ $.widget("ui.selectable", $.ui.mouse, {
                this.helper = $("<div class='ui-selectable-helper'></div>");
        },
 
-       destroy: function() {
+       _destroy: function() {
                this.selectees
                        .removeClass("ui-selectee")
                        .removeData("selectable-item");
                this.element
-                       .removeClass("ui-selectable ui-selectable-disabled")
-                       .removeData("selectable")
-                       .unbind(".selectable");
+                       .removeClass("ui-selectable ui-selectable-disabled");
                this._mouseDestroy();
-
-               return this;
        },
 
        _mouseStart: function(event) {
-               var self = this;
+               var that = this;
 
                this.opos = [event.pageX, event.pageY];
 
@@ -109,7 +107,7 @@ $.widget("ui.selectable", $.ui.mouse, {
                                selectee.$element.addClass('ui-unselecting');
                                selectee.unselecting = true;
                                // selectable UNSELECTING callback
-                               self._trigger("unselecting", event, {
+                               that._trigger("unselecting", event, {
                                        unselecting: selectee.element
                                });
                        }
@@ -127,11 +125,11 @@ $.widget("ui.selectable", $.ui.mouse, {
                                selectee.selected = doSelect;
                                // selectable (UN)SELECTING callback
                                if (doSelect) {
-                                       self._trigger("selecting", event, {
+                                       that._trigger("selecting", event, {
                                                selecting: selectee.element
                                        });
                                } else {
-                                       self._trigger("unselecting", event, {
+                                       that._trigger("unselecting", event, {
                                                unselecting: selectee.element
                                        });
                                }
@@ -142,7 +140,7 @@ $.widget("ui.selectable", $.ui.mouse, {
        },
 
        _mouseDrag: function(event) {
-               var self = this;
+               var that = this;
                this.dragged = true;
 
                if (this.options.disabled)
@@ -158,7 +156,7 @@ $.widget("ui.selectable", $.ui.mouse, {
                this.selectees.each(function() {
                        var selectee = $.data(this, "selectable-item");
                        //prevent helper from being selected if appendTo: selectable
-                       if (!selectee || selectee.element == self.element[0])
+                       if (!selectee || selectee.element == that.element[0])
                                return;
                        var hit = false;
                        if (options.tolerance == 'touch') {
@@ -181,7 +179,7 @@ $.widget("ui.selectable", $.ui.mouse, {
                                        selectee.$element.addClass('ui-selecting');
                                        selectee.selecting = true;
                                        // selectable SELECTING callback
-                                       self._trigger("selecting", event, {
+                                       that._trigger("selecting", event, {
                                                selecting: selectee.element
                                        });
                                }
@@ -201,7 +199,7 @@ $.widget("ui.selectable", $.ui.mouse, {
                                                        selectee.unselecting = true;
                                                }
                                                // selectable UNSELECTING callback
-                                               self._trigger("unselecting", event, {
+                                               that._trigger("unselecting", event, {
                                                        unselecting: selectee.element
                                                });
                                        }
@@ -214,7 +212,7 @@ $.widget("ui.selectable", $.ui.mouse, {
                                                selectee.$element.addClass('ui-unselecting');
                                                selectee.unselecting = true;
                                                // selectable UNSELECTING callback
-                                               self._trigger("unselecting", event, {
+                                               that._trigger("unselecting", event, {
                                                        unselecting: selectee.element
                                                });
                                        }
@@ -226,7 +224,7 @@ $.widget("ui.selectable", $.ui.mouse, {
        },
 
        _mouseStop: function(event) {
-               var self = this;
+               var that = this;
 
                this.dragged = false;
 
@@ -237,7 +235,7 @@ $.widget("ui.selectable", $.ui.mouse, {
                        selectee.$element.removeClass('ui-unselecting');
                        selectee.unselecting = false;
                        selectee.startselected = false;
-                       self._trigger("unselected", event, {
+                       that._trigger("unselected", event, {
                                unselected: selectee.element
                        });
                });
@@ -247,7 +245,7 @@ $.widget("ui.selectable", $.ui.mouse, {
                        selectee.selecting = false;
                        selectee.selected = true;
                        selectee.startselected = true;
-                       self._trigger("selected", event, {
+                       that._trigger("selected", event, {
                                selected: selectee.element
                        });
                });
@@ -260,8 +258,4 @@ $.widget("ui.selectable", $.ui.mouse, {
 
 });
 
-$.extend($.ui.selectable, {
-       version: "1.8.24"
-});
-
 })(jQuery);