dist/hashedit.js
function() {

      var x, el, selector, sortable, item, action, html;

      // setup sortable on the menu
      el = document.querySelector('.hashedit-menu-body');

      sortable = new Sortable(el, {
        group: {
          name: 'hashedit-sortable',
          pull: 'clone',
          put: false
        },
        draggable: 'a',
        sort: false, // sorting inside list
        delay: 0, // time in milliseconds to define when the sorting should start
        disabled: false, // Disables the sortable if set to true.
        animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
        ghostClass: "hashedit-highlight", // Class name for the drop placeholder

        scroll: true, // or HTMLElement
        scrollSensitivity: 30, // px, how near the mouse must be to an edge to start scrolling.
        scrollSpeed: 10, // px

        onStart: function(evt) {

          document.querySelector('.hashedit-menu').removeAttribute('active');

        },

        // dragging ended
        onEnd: function(evt) {

          // get item
          item = evt.item;

          if (hashedit.debug === true) {
            console.log(item);
          }

          // get action
          selector = item.getAttribute('data-selector');

          // append html associated with action
          for (x = 0; x < hashedit.menu.length; x += 1) {
            if (hashedit.menu[x].selector == selector) {
              html = hashedit.menu[x].html;
              html = hashedit.replaceAll(html, '{{path}}', hashedit.path);
              html = hashedit.replaceAll(html, '{{framework.image}}', hashedit.frameworkDefaults[hashedit.framework].image);
              html = hashedit.replaceAll(html, '{{framework.table}}', hashedit.frameworkDefaults[hashedit.framework].table);
              html = hashedit.replaceAll(html, '{{framework.code}}', hashedit.frameworkDefaults[hashedit.framework].code);

              var node = hashedit.append(html);

              // add
              if(hashedit.menu[x].view != undefined) {
                node.innerHTML += hashedit.menu[x].view;
              }

            }
          }

          // setup empty columns
          hashedit.setupEmpty();

          // remove help
          var help = document.querySelector('.hashedit-help');

          if(help != null) {
            help.innerHTML = '';
            help.removeAttribute('active');
          }

          return false;

        }
      });
    }
function() {

      var x, el, selector, sortable, item, action, html;

      // setup sortable on the menu
      el = document.querySelector('.hashedit-menu-body');

      sortable = new Sortable(el, {
        group: {
          name: 'hashedit-sortable',
          pull: 'clone',
          put: false
        },
        draggable: 'a',
        sort: false, // sorting inside list
        delay: 0, // time in milliseconds to define when the sorting should start
        disabled: false, // Disables the sortable if set to true.
        animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
        ghostClass: "hashedit-highlight", // Class name for the drop placeholder

        scroll: true, // or HTMLElement
        scrollSensitivity: 30, // px, how near the mouse must be to an edge to start scrolling.
        scrollSpeed: 10, // px

        onStart: function(evt) {

          document.querySelector('.hashedit-menu').removeAttribute('active');

        },

        // dragging ended
        onEnd: function(evt) {

          // get item
          item = evt.item;

          if (hashedit.debug === true) {
            console.log(item);
          }

          // get action
          selector = item.getAttribute('data-selector');

          // append html associated with action
          for (x = 0; x < hashedit.menu.length; x += 1) {
            if (hashedit.menu[x].selector == selector) {
              html = hashedit.menu[x].html;
              html = hashedit.replaceAll(html, '{{path}}', hashedit.path);
              html = hashedit.replaceAll(html, '{{framework.image}}', hashedit.frameworkDefaults[hashedit.framework].image);
              html = hashedit.replaceAll(html, '{{framework.table}}', hashedit.frameworkDefaults[hashedit.framework].table);
              html = hashedit.replaceAll(html, '{{framework.code}}', hashedit.frameworkDefaults[hashedit.framework].code);

              var node = hashedit.append(html);

              // add
              if(hashedit.menu[x].view != undefined) {
                node.innerHTML += hashedit.menu[x].view;
              }

            }
          }

          // setup empty columns
          hashedit.setupEmpty();

          // remove help
          var help = document.querySelector('.hashedit-help');

          if(help != null) {
            help.innerHTML = '';
            help.removeAttribute('active');
          }

          return false;

        }
      });
    }
function ( ) { var x , el , selector , sortable , item , action , html ; // setup sortable on the menu el = document . querySelector ( '.hashedit-menu-body' ) ; sortable = new Sortable ( el , { group : { name : 'hashedit-sortable' , pull : 'clone' , put : false } , draggable : 'a' , sort : false , // sorting inside list delay : 0 , // time in milliseconds to define when the sorting should start disabled : false , // Disables the sortable if set to true. animation : 150 , // ms, animation speed moving items when sorting, `0` — without animation ghostClass : "hashedit-highlight" , // Class name for the drop placeholder scroll : true , // or HTMLElement scrollSensitivity : 30 , // px, how near the mouse must be to an edge to start scrolling. scrollSpeed : 10 , // px onStart : function ( evt ) { document . querySelector ( '.hashedit-menu' ) . removeAttribute ( 'active' ) ; } , // dragging ended onEnd : function ( evt ) { // get item item = evt . item ; if ( hashedit . debug === true ) { console . log ( item ) ; } // get action selector = item . getAttribute ( 'data-selector' ) ; // append html associated with action for ( x = 0 ; x < hashedit . menu . length ; x += 1 ) { if ( hashedit . menu [ x ] . selector == selector ) { html = hashedit . menu [ x ] . html ; html = hashedit . replaceAll ( html , '{{path}}' , hashedit . path ) ; html = hashedit . replaceAll ( html , '{{framework.image}}' , hashedit . frameworkDefaults [ hashedit . framework ] . image ) ; html = hashedit . replaceAll ( html , '{{framework.table}}' , hashedit . frameworkDefaults [ hashedit . framework ] . table ) ; html = hashedit . replaceAll ( html , '{{framework.code}}' , hashedit . frameworkDefaults [ hashedit . framework ] . code ) ; var node = hashedit . append ( html ) ; // add if ( hashedit . menu [ x ] . view != undefined ) { node . innerHTML += hashedit . menu [ x ] . view ; } } } // setup empty columns hashedit . setupEmpty ( ) ; // remove help var help = document . querySelector ( '.hashedit-help' ) ; if ( help != null ) { help . innerHTML = '' ; help . removeAttribute ( 'active' ) ; } return false ; } } ) ; }
Setup draggable events on menu items
Setup draggable events on menu items