Commits

Andrew Lim  committed a906e9a

save menu items are disabled instead of hidden - appearance only, need to redo click handlers

  • Participants
  • Parent commits 1dfe5ec

Comments (0)

Files changed (2)

File layout/navbar.mint

 
 #def parseMenuItem(menu,level=0):
     #if menu['id'] == 'sep':
-        @li.class(divider).data-group({{ menu['group'] if 'group' in menu else '' }})
+        @li.class(divider).data-group({{ menu['group'] if 'group' in menu else '' }}).data-wtype(menu)
     #elif 'items' in menu:
         #if level == 0:
-            @li.class(dropdown).id({{ menu['id'] }}).data-group({{ menu['group'] if 'group' in menu else '' }})
+            @li.class(dropdown).id({{ menu['id'] }}).data-group({{ menu['group'] if 'group' in menu else '' }}).data-wtype(menu)
                 @a.href(#).class(dropdown-toggle).data-toggle(dropdown)
                     #printMenuTitle(menu)
                     @b.class(caret)
                     #for subitem in menu['items']:
                         #parseMenuItem(subitem,level+1)
         #else:
-            @li.class(dropdown-submenu).id({{ menu['id'] }}).data-group({{ menu['group'] if 'group' in menu else '' }})
+            @li.class(dropdown-submenu).id({{ menu['id'] }}).data-group({{ menu['group'] if 'group' in menu else '' }}).data-wtype(menu)
                 @a.href(#)
                     #printMenuTitle(menu)
                 @ul.class(dropdown-menu)
                         #parseMenuItem(subitem,level+1)
 
     #else:
-        @li.id({{ menu['id'] }}).data-group({{ menu['group'] if 'group' in menu else '' }})
+        @li.id({{ menu['id'] }}).data-group({{ menu['group'] if 'group' in menu else '' }}).data-wtype(menu)
             @a.href(#).onClick({{ jsf(menu['action']) if 'action' in menu else ''}})
                 #printMenuTitle(menu)
 
                 @a.href(#).id(languagetitle) {{ nbsp }}
             @li.class(active)
                 @a.href(#).id(filetitle) Loading...
-            @li.data-group(openFileActions)
+            @li.data-group(openFileActions).data-wtype(button)
                 @a.href(#).onClick({{ closeFile() }}) 
                     @i.class(icon-remove)

File static/js/main.js

         file = currentFile();
         $('#filetitle').html('/'+file['path']);
         $('#languagetitle').html(file['lang']['name']);
-        $('[data-group="openFileActions"]').show(100);
+        $('[data-group="openFileActions"][data-wtype="button"]').show(100);
+        $('[data-group="openFileActions"][data-wtype="menu"]').removeClass('disabled');
     }
     else {
         $('#tablist').html('<li class="disabled"><a href="#">No Files Open</a></li>');
         $('#filetitle').html('Please open a file.');
         $('#languagetitle').html('&nbsp;');
-        $('[data-group="openFileActions"]').hide(100);
+        $('[data-group="openFileActions"][data-wtype="button"]').hide(100);
+        $('[data-group="openFileActions"][data-wtype="menu"]').addClass('disabled');
     }
 }