diff options
Diffstat (limited to '')
-rw-r--r-- | themes/default/js/ui/jquery.ui.selectable.js | 61 |
1 files changed, 28 insertions, 33 deletions
diff --git a/themes/default/js/ui/jquery.ui.selectable.js b/themes/default/js/ui/jquery.ui.selectable.js index 0b8f9b6f2..5980e0ddb 100644 --- a/themes/default/js/ui/jquery.ui.selectable.js +++ b/themes/default/js/ui/jquery.ui.selectable.js @@ -1,11 +1,12 @@ -/* - * jQuery UI Selectable 1.8.16 +/*! + * jQuery UI Selectable 1.9.0 + * http://jqueryui.com * - * Copyright 2011, 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.0", 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,8 @@ $.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); var pos = $this.offset(); @@ -59,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]; @@ -102,13 +101,13 @@ $.widget("ui.selectable", $.ui.mouse, { this.selectees.filter('.ui-selected').each(function() { var selectee = $.data(this, "selectable-item"); selectee.startselected = true; - if (!event.metaKey) { + if (!event.metaKey && !event.ctrlKey) { selectee.$element.removeClass('ui-selected'); selectee.selected = false; selectee.$element.addClass('ui-unselecting'); selectee.unselecting = true; // selectable UNSELECTING callback - self._trigger("unselecting", event, { + that._trigger("unselecting", event, { unselecting: selectee.element }); } @@ -117,7 +116,7 @@ $.widget("ui.selectable", $.ui.mouse, { $(event.target).parents().andSelf().each(function() { var selectee = $.data(this, "selectable-item"); if (selectee) { - var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected'); + var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); selectee.$element .removeClass(doSelect ? "ui-unselecting" : "ui-selected") .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); @@ -126,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 }); } @@ -141,7 +140,7 @@ $.widget("ui.selectable", $.ui.mouse, { }, _mouseDrag: function(event) { - var self = this; + var that = this; this.dragged = true; if (this.options.disabled) @@ -157,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') { @@ -180,14 +179,14 @@ $.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 }); } } else { // UNSELECT if (selectee.selecting) { - if (event.metaKey && selectee.startselected) { + if ((event.metaKey || event.ctrlKey) && selectee.startselected) { selectee.$element.removeClass('ui-selecting'); selectee.selecting = false; selectee.$element.addClass('ui-selected'); @@ -200,20 +199,20 @@ $.widget("ui.selectable", $.ui.mouse, { selectee.unselecting = true; } // selectable UNSELECTING callback - self._trigger("unselecting", event, { + that._trigger("unselecting", event, { unselecting: selectee.element }); } } if (selectee.selected) { - if (!event.metaKey && !selectee.startselected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { selectee.$element.removeClass('ui-selected'); selectee.selected = false; selectee.$element.addClass('ui-unselecting'); selectee.unselecting = true; // selectable UNSELECTING callback - self._trigger("unselecting", event, { + that._trigger("unselecting", event, { unselecting: selectee.element }); } @@ -225,7 +224,7 @@ $.widget("ui.selectable", $.ui.mouse, { }, _mouseStop: function(event) { - var self = this; + var that = this; this.dragged = false; @@ -236,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 }); }); @@ -246,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 }); }); @@ -259,8 +258,4 @@ $.widget("ui.selectable", $.ui.mouse, { }); -$.extend($.ui.selectable, { - version: "1.8.16" -}); - })(jQuery); |