0

jQuery UI 1.11 + Fancytree 2.3.0

$("#tree").fancytree({
  extensions: ["edit", "dnd"],
  edit{ ... },
  dnd{ ... },
  ...
});

[DnD]

  • Already effective.

[Edit]

  • [F2] - ignore.
  • [Shift+Click] - effective.

Couldn't F2 key when use dnd extension. Why sabotage the "F2" ?

1 Answers1

1

[jQuery UI 1.11 - Draggable]

var mouse = $.widget("ui.mouse", {
  ...
  _mouseDown: function(event) {
    ...
    this.document
      .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
      .bind( "mouseup." + this.widgetName, this._mouseUpDelegate );

    event.preventDefault();

    mouseHandled = true;
    return true;
},

Fancytree(ul.fancytree-container) missing focus when blocking event.preventDefault().

If you can stubborn focusing. try this code.

$("#tree").fancytree({
  extensions: ["edit", "dnd"],
  edit{ ... },  
  dnd{ ... },
  click: function(event, data){
    data.tree.$container.focus();
  },
  ...
});
  • negative. code-comment says 'draggable cancels mousedown' but nothing has worked for me. :S – Norikaz Ishii Aug 26 '14 at 03:12
  • maybe dnd.focusOnClick have a other problem. I make issue: https://github.com/mar10/fancytree/issues/300 – Norikaz Ishii Aug 27 '14 at 04:21
  • This solution worked for me. If it's an option for you, you can resort to using jQuery UI 1.10.4. It also worked, but I'd rather use a newer version of jQuery UI. – zak_mckraken Sep 30 '14 at 17:31