<?php

if (!defined('PARENT') || !isset($cmd)) { exit; }

/* SORTING
   For settings options
------------------------------------------*/

?>
<script src="content/js/plugins/sortable.js"></script>
<script>
//<![CDATA[
jQuery(function() {
  var el = document.getElementById('sesort');
  var tr = jQuery('#sesort .dragarea').length;
  if (tr > 1) {
    Sortable.create(el, {
      animation   : 150,
      ghostClass  : 'sortable-class',
      onEnd       : function () {
        if (!jQuery('input[name="fm[menu_drag]"]').html() && jQuery('input[name="fm[menu_drag]"]').val() != 'yes') {
          jQuery('form').append('<input type="hidden" name="fm[menu_drag]" value="yes">');
        }
      }
    });
  }
});
//]]>
</script>