From: Charles du Jeu Date: Mon, 8 Dec 2008 19:10:15 +0000 (+0000) Subject: Initialize menuClones in the constructor X-Git-Tag: argeo-slc-2.1.7~2299 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=9120f32a4cb34b9b46bbfbf02ba34e64d2da2312;p=gpl%2Fargeo-slc.git Initialize menuClones in the constructor git-svn-id: https://svn.argeo.org/slc/trunk@1963 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/event/Command.js b/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/event/Command.js index b42fd4338..83641c416 100644 --- a/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/event/Command.js +++ b/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/event/Command.js @@ -49,6 +49,7 @@ this.setId(id); this.setLabel(label); this.setIcon(icon); + this.menuClones = []; }, members : @@ -62,14 +63,13 @@ this.getLabel(), this.getIcon(), this, - this.getMenu() + this.getMenuClone() ); this.addTooltip(button); if(this.getMenu()){ this.addListener("changeMenu", function(event){ button.setMenu(this.getMenuClone()); - }, this); - this.menuClones = []; + }, this); } return button; }, @@ -111,6 +111,7 @@ getMenuClone : function(){ var menuClone = new qx.ui.menu.Menu(); var submenus = this.getMenu(); + if(!submenus) return; for(var i=0;i