Author: hannes
Date: 2008-12-19 15:25:32 +0100 (Fri, 19 Dec 2008)
New Revision: 9449
Modified:
apps/gobi/trunk/code/Global/components/menu.js
apps/gobi/trunk/code/Global/components/menu.skin
apps/gobi/trunk/code/Page/PageMacros.js
Log:
Add id argument to HtmlMenu component to make the id customizable.
Details at http://dev.helma.org/trac/helma/changeset/9449
Modified: apps/gobi/trunk/code/Global/components/menu.js
===================================================================
--- apps/gobi/trunk/code/Global/components/menu.js 2008-12-18 15:31:54 UTC (rev 9448)
+++ apps/gobi/trunk/code/Global/components/menu.js 2008-12-19 14:25:32 UTC (rev 9449)
@@ -1,8 +1,10 @@
-function HtmlMenu(label, items) {
+function HtmlMenu(label, id, items) {
+
this.render = function() {
renderSkin("menu#main", {
label: label,
+ id: id,
items_macro: function() {
for (var i = 0; i < items.length; i++) {
renderSkin("menu#item", {
Modified: apps/gobi/trunk/code/Global/components/menu.skin
===================================================================
--- apps/gobi/trunk/code/Global/components/menu.skin 2008-12-18 15:31:54 UTC (rev 9448)
+++ apps/gobi/trunk/code/Global/components/menu.skin 2008-12-19 14:25:32 UTC (rev 9449)
@@ -1,8 +1,8 @@
<% #main %>
-<a href='' onclick="toggleMenu('menu'); return false;">
+<a href='' onclick="toggleMenu('<% param.id %>'); return false;">
<% param.label %>
</a>
-<div id='menu' class='menu' style='display: none;'>
+<div id='<% param.id %>' class='menu' style='display: none;'>
<% param.items %>
</div>
Modified: apps/gobi/trunk/code/Page/PageMacros.js
===================================================================
--- apps/gobi/trunk/code/Page/PageMacros.js 2008-12-18 15:31:54 UTC (rev 9448)
+++ apps/gobi/trunk/code/Page/PageMacros.js 2008-12-19 14:25:32 UTC (rev 9449)
@@ -92,7 +92,7 @@
function adminlinks_macro(param) {
if (this.checkPermission(ADMIN)) {
- new HtmlMenu("manage", this.getAdminActions()).render();
+ new HtmlMenu("manage", "manage-menu", this.getAdminActions()).render();
}
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.