mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-03 02:41:12 +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'
Origin commit data
------------------
Commit: a78fcbc6a9
Author: vanhofen <vanhofen@gmx.de>
Date: 2013-07-05 (Fri, 05 Jul 2013)
Origin message was:
------------------
- 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