r3118 committed - selectable dev: lasso can now be started on items always, miraculously...

r3118 committed - selectable dev: lasso can now be started on items always, miraculously...


Revision: 3118
Author: paul.bakaus
Date: Sun Aug 23 04:20:58 2009
Log: selectable dev: lasso can now be started on items always, miraculously
draggable() disables lasso automatically right now, which is good, but
frightening (see draggable selectable demo)
http://code.google.com/p/jquery-ui/source/detail?r=3118
Modified:
/branches/dev/selectable/demos/selectable/draggable.html
/branches/dev/selectable/ui/ui.selectable.js
=======================================
--- /branches/dev/selectable/demos/selectable/draggable.html    Fri Aug 21
07:52:34 2009
+++ /branches/dev/selectable/demos/selectable/draggable.html    Sun Aug 23
04:20:58 2009
@@ -81,13 +81,13 @@
            }
        });
-
+
        $('#selectable img').draggable({
            cursorAt: { left: -10, top: -10 },
            appendTo: 'body',
            helper: function(event) {
-                var selected = $("#selectable img.ui-state-selected"),
+                var selected = $("#selectable img.ui-state-active"),
                    set = $('<div class="temp"></div>').css({ zIndex: 10, width: 80,
height: Math.ceil(selected.length / 5) * 16 }),
                    offset = $(this).offset(),
                    click = { left: event.pageX - offset.left, top: event.pageY -
offset.top };
@@ -101,7 +101,7 @@
                    var o = $(this).offset();
                    var copy = $(this).clone()
-                        .addClass('ui-state-selected')
+                        .addClass('ui-state-active')
                        .css({
                            width: $(this).width(), height: $(this).height(),
                            margin: 0, position: 'absolute', outline: '5px solid #fff',
=======================================
--- /branches/dev/selectable/ui/ui.selectable.js    Sun Aug 23 04:00:47 2009
+++ /branches/dev/selectable/ui/ui.selectable.js    Sun Aug 23 04:20:58 2009
@@ -34,7 +34,7 @@
                // we need to move the lasso options onto the root options for the
mouse clas
                if(this.options.lasso !== true) {
-                    $.extend(this.options, this.options.lasso);
+                    $.extend(this.options, this.options.lasso);
                }
                this._mouseInit();
@@ -45,7 +45,7 @@
                    var item = self._targetIsItem(event.target);
                    if (!item) return;
-
+
                    // If item is part of current selection and current
                 // selection is multiple, return and allow mouseup
                 // to fire (Windows gets this right too, OSX doesn't)
@@ -194,11 +194,11 @@
        _mouseCapture: function(event) {
            //If the item we start dragging on is a selectable, we bail (if
keyboard is used)
            this.clickedOnItem = this._targetIsItem(event.target);
-            return !this.options.keyboard || !this.clickedOnItem;
+            return true; // TODO: this starts the lasso on items as well - we might
want to introduce an option to disable this
        },
        _mouseStart: function(event) {
-
+
            var self = this, o = this.options;
            this.opos = [event.pageX, event.pageY];