Changes between Initial Version and Version 1 of Ticket #4333, comment 47


Ignore:
Timestamp:
Feb 9, 2011, 7:55:11 AM (11 years ago)
Author:
markchagers
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4333, comment 47

    initial v1  
    11I'm running into this very issue with 1.8.9 and it's a MAJOR showstopper.
    22
    3 I have a list of items that can be up to 3 levels deep. The user can drag items around to reorder them.
    4 
     3I have a list of items that can be up to 3 levels deep. The user can drag items around to reorder them. [[BR]]
    54Works fine in FireFox, Chrome, Safari and IE 9 beta.
    65
    76In IE8 when dragging a nested list item, the parent item(s) is (are) dragged simultaniously, causing the nested item to be moved twice or three times the dragging distance (depending on nesting depth of the dragged item).
     7
     8Update: Fortunately the fix by TitAn works for me too. Makes me wonder why this hasn't been incorporated in the release yet.[[BR]]
     9I apply it using the patch mechanism suggested by oribami, but I moved the browser check to surround the patch itself: That way the patch is only applied when necessary, and it saves a check on every mouseCapture event. like this:
     10
     11$(document).ready(function () {
     12
     13    if ($.browser.msie && $.browser.version < 9) {
     14        // patch draggable to fix the problem in IE 8 and below
     15        /*change by Titkov Anton : bug #4333 (http://dev.jqueryui.com/ticket/4333)*/
     16        // MHagers, added version check as IE 9 doesn't display this issue
     17        $.extend($.ui.draggable.prototype, (function (orig) {
     18            return {
     19                _mouseCapture: function (event) {
     20                    var result = orig.call(this, event);
     21                    if (result) event.stopPropagation();
     22                    return result;
     23                }
     24            };
     25        })($.ui.draggable.prototype["_mouseCapture"]));
     26    }
     27});