Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix in jqtree for Chrome -instead of moving to Page admin after mouse click it drags element #54

Open
Kurdakov opened this issue Jul 21, 2016 · 0 comments

Comments

@Kurdakov
Copy link

Kurdakov commented Jul 21, 2016

I was annoyed, that in admin
jqtree won't pass click over link to page admin ( I tried different versions of jqtree it turn out latest which would work in jqtree 0.10 ( which was released long time ago ), so even if possibly this problem is fixed in jqtree ( don't know )

so added following fix to tree.jquery.js see line

elementMouseIsOver = document.elementFromPoint(event.clientX, event.clientY);
in  JqTreeWidget.prototype._mouseStart = function(event) {

JqTreeWidget.prototype._mouseStart = function(event) {
      var offsetX, offsetY, _ref,elementMouseIsOver;
      if (!this.options.dragAndDrop) {
        return;
      }
      this._refreshHitAreas();
      _ref = this._getOffsetFromEvent(event), offsetX = _ref[0], offsetY = _ref[1];
      elementMouseIsOver = document.elementFromPoint(event.clientX, event.clientY);
          elementMouseIsOver = document.elementFromPoint(event.clientX, event.clientY);
      if(elementMouseIsOver != null)
      {  
              if (elementMouseIsOver.getAttribute("href") != null || elementMouseIsOver.getAttribute("src") != null) 
          { 
            return;
          }
      }
      this.drag_element = new DragElement(this.current_item.node, offsetX, offsetY, this.element);
      this.is_dragging = true;
      this.current_item.$element.addClass('moving');
      return true;
    };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant