title: Uncaught Error: cannot call methods on draggable prior to initialization; attempted to call method 'disable'
body: <p><a href="https://jsfiddle.net/scottbeeson/r5du4p6k/12/" rel="nofollow noreferrer">https://jsfiddle.net/scottbeeson/r5du4p6k/12/</a></p>
  
  <p>If you long-press to drag, when you release you get the following error:</p>
  
  <blockquote>
    <p>Uncaught Error: cannot call methods on draggable prior to initialization; attempted to call method 'disable'</p>
  </blockquote>
  
  <pre><code>var t;
  $(document).on('touchstart mousedown','.menu-item', function (event) {
      var self = this;
      if ($(self).hasClass('draggable')) return;
      t = setTimeout(function () {
          $(self).draggable({
              revert: true,
              helper: 'clone',
              opacity: .75,
              appendTo: 'body'
          }).draggable('enable').addClass('draggable');
          $(self).trigger(event)
      }, 800);
  });
  
  $(document).on("touchend mouseup", function () {
      clearTimeout(t);
      $('.draggable').draggable( 'disable' ).removeClass('draggable');
  });
  </code></pre>