Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7710791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:12:41+00:00 2026-06-01T01:12:41+00:00

The server is running off Ruby on Rails. Javascript is written using Coffeescript. I

  • 0

The server is running off Ruby on Rails. Javascript is written using Coffeescript.

I am currently using the jQuery File Tree plugin with the Context Menu plugin. Both are working at the moment, with one minor problem. I also have draggable enabled in the file tree and it will not cancel after the left click is released. In the picture below, the mouse has been released already.

Mouse up but draggable hasn’t cancelled

The page this is loaded on has one div:

<div id="file_tree"></div>

And this div is filled by another page from a different controller. The code is:

<ul class="jqueryFileTree" style="display: none;">
  <% @contents[0].each do |directory| %>
    <li class="directory collapsed"><a href="#" rel="<%= @root + directory %>/"><%= directory %></a></li>
  <% end %>
  <% @contents[1].each do |file| %>
    <li class="file ext_<%= File.extname(file)[1..-1] %>"><a href="#" rel="<%= @root + file %>"><%= file %></a></li>
  <% end %>
</ul>

This page also loads the draggable code:

$ ->
@settings =
  revert: true
  helper: "clone"
  containment: "#file_tree"
  axis: "y"
  scroll: true
  cursorAt:
    top: -2

$(".directory").draggable(@settings)
$(".file").draggable(@settings)

And the context menu is added like this:

$("#file_tree").contextMenu { menu: 'filetree_context_menu' }, (action, element, position) =>
  @on_context_menu(action, element, position, data.root_directory)

Where @on_context_menu is simply a function (it has no bearing on this problem though).

The problem can be stopped (the clone returns to its original) if you click outside the #file_tree div. However, it appears that click, mousedown, and mouseup events are handled correctly. Also, the context menu has no problems and will not induce the draggable problem.

In regards to my searching around for fixes, I have found nothing. The File Tree plugin has an okay amount of information floating around, but the Context Menu one seems to have next to nothing (must be unpopular?). And none of those have both at the same time. If you need some other information, please state.

EDIT: I figured out that this is actually because the plugin needs to call e.stopPropogation() on the mouseup event to prevent it from opening a real context menu. Anybody know how to manually perform a stopdrag() event? It’s not working if I call $(this).trigger(‘stopdrag’) in case you were going to suggest that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:12:43+00:00Added an answer on June 1, 2026 at 1:12 am

    Eventually fixed this problem (after quite a while, and while procrastinating to get a Tumbleweed). Just added a check that it was the right button that was clicked, because it was breaking drag by running e.stopPropagation() on BOTH clicks. It’s much cleaner than my original work-around that I scrapped.

    if(e.button == 2) {
      e.stopPropagation();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Rails 3.1, Ruby 1.9.2, using a SQL Server 2008 database through the activerecord-sqlserver-adapter gem.
I have a web application that needs to fire off a long-running SQL Server
I've got a rails website and a small minecraft server running on a linode
I'm trying to upload a file to my Spring server running on Tomcat7. It's
So I have few ASP.NET apps all running off SQL Server Express 2008 and
I have a HTML website running off Apache and using a MySQL database. I
I am currently using Net::HTTP in a Ruby script to post files to a
I have CollabNet Subversion server and client installed, running off of Apache that came
I am using WAMP server running PHP. At a particular step I am trying
I have a shared development server with many virtual directories running off one of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.