11/**
2- * A complete jQuery Menu Editor
3- * @author David Ticona Saravia
2+ * jQuery Menu Editor
3+ * @author David Ticona Saravia https://github.com/davicotico
4+ * @version 0.9.0
45 * */
56( function ( $ ) {
67 /**
@@ -854,7 +855,8 @@ function MenuEditor(idSelector, options) {
854855 }
855856 MenuEditor . updateButtons ( $main ) ;
856857 } ) ;
857- /*PRIVATE METHODS*/
858+
859+ /* PRIVATE METHODS */
858860 function editItem ( $item ) {
859861 var data = $item . data ( ) ;
860862 $ . each ( data , function ( p , v ) {
@@ -874,13 +876,15 @@ function MenuEditor(idSelector, options) {
874876 return 'empty' ;
875877 }
876878 }
879+
877880 function resetForm ( ) {
878881 $form [ 0 ] . reset ( ) ;
879882 iconPicker = iconPicker . iconpicker ( iconPickerOpt ) ;
880883 iconPicker . iconpicker ( 'setIcon' , 'empty' ) ;
881884 $updateButton . attr ( 'disabled' , true ) ;
882885 itemEditing = null ;
883886 }
887+
884888 function stringToArray ( str ) {
885889 try {
886890 var obj = JSON . parse ( str ) ;
@@ -938,6 +942,7 @@ function MenuEditor(idSelector, options) {
938942 } ) ;
939943 return $elem ;
940944 }
945+
941946 function TOpener ( li ) {
942947 var opener = $ ( '<span>' ) . addClass ( 'sortableListsOpener ' + options . opener . openerClass ) . css ( options . opener . openerCss )
943948 . on ( 'mousedown' , function ( e ) {
@@ -964,7 +969,7 @@ function MenuEditor(idSelector, options) {
964969 }
965970 } ) ;
966971 }
967- /*PUBLIC METHODS*/
972+ /* PUBLIC METHODS */
968973 this . setForm = function ( form ) {
969974 $form = form ;
970975 } ;
@@ -1037,6 +1042,11 @@ function MenuEditor(idSelector, options) {
10371042 }
10381043 } ;
10391044} ;
1045+ /* STATIC METHOD */
1046+ /**
1047+ * Update the buttons on the list. Only the buttons 'Up', 'Down', 'In', 'Out'
1048+ * @param {jQuery } $mainList The unorder list
1049+ **/
10401050MenuEditor . updateButtons = function ( $mainList ) {
10411051 $mainList . find ( '.btnMove' ) . show ( ) ;
10421052 $mainList . updateButtons ( ) ;
0 commit comments