title: jQuery UI Sortable - Using setTimeout to enable sorting
body: <p>I'm using jQuery UI Sortable and I don't want to enable sorting until the user clicks and holds down the mouse on the sortable element for about a second or so. Currently i'm trying to use setTimeout.</p>
  
  <pre><code>$(function() {
  
      var globalTimer = 0;
  
      $("li").on("mousedown", function() {
  
        globalTimer = setTimeout(function() {
  
          $(".sortable").sortable({
            stop: function() {
  
              $(".sortable").sortable("disable");
  
            }
          }).sortable("enable");
      }, 400);
  });
  
      $("li").on("mouseup mouseleave", function() {
  
        clearTimeout(globalTimer);
  
      });
  });
  </code></pre>
  
  <p>This is making the items sortable after clicking and holding for 400 ms, then releasing, then clicking again. I would like them to be sortable after clicking and holding for 400 ms right away.</p>
  
  <p>Here is a JSFiddle to better illustrate the problem <a href="https://jsfiddle.net/6jcc6xkf/2/" rel="nofollow">JSFiddle</a></p>
  
  <p>Any help is appreciated, thanks!</p>