mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 09:21:18 +02:00
- yweb: add new function 'add_yExtensions()' to avoid duplicate code
* remove prefix '-' from added items * add class 'y_menu_sec_ext' to added items * rename unused class 'y_menu_prim_item' to 'y_menu_prim_ext'
This commit is contained in:
@@ -182,6 +182,22 @@ Object.extend(Y.extension.prototype, {
|
||||
},this);
|
||||
}
|
||||
});
|
||||
|
||||
function add_yExtensions(_ymenu, _id) {
|
||||
var menu=ext.select_menu(_ymenu);
|
||||
menu.each(function(e){
|
||||
var el=new Element('li').update(
|
||||
new Element('a', {
|
||||
'class': (_ymenu == 'main') ? 'y_menu_prim_ext' : 'y_menu_sec_ext',
|
||||
'target': (_ymenu == 'main') ? 'base' : 'work',
|
||||
'title': e.get('desc'),
|
||||
'href': e.get('file')
|
||||
}).update(e.get('menuitem'))
|
||||
);
|
||||
$(_id).insert({'bottom':el});
|
||||
});
|
||||
}
|
||||
|
||||
/* singleton pattern*/
|
||||
if (window == top.top_main.prim_menu) {
|
||||
var ext = new Y.extension();
|
||||
|
Reference in New Issue
Block a user