From fe84c1c0418c1457d95e85a61d90f39c547d4bf2 Mon Sep 17 00:00:00 2001 From: Benjamin Schmid Date: Mon, 27 Feb 2012 13:18:21 +0100 Subject: [PATCH 1/2] Extras.DropDownMenu menuWidth property support Patch provided by ScoPi http://echo.nextapp.com/site/node/6713 Evidently the Extras.DropDownMenu wasn't totally fleshed out; a documented "menuWidth" property wasn't actually being applied. This change fixes that and makes the current mouseover span the width of the drop down menu. I've tested it in IE 9 and the latest Firefox. On a sidenote regarding the usage of Extras.DropDownMenu: be aware that the undocumented "selection" property of Extras.DropDownMenu refers to the index of the menu item to be selected if the "selectionEnabled" property is true and thus using that property is enabled. If the menu item model of the menu is complex, then the selection property is actually a path to the selected item in the form "firstLevelIndex.secondLevelIndex.thirdLevelIndex.andSoOn" (i.e. "3.2.5.9.13" refers to the 13th menu item in the 9th menu item in the 5th menu item in the 2nd menu item in the 3rd menu item). Note that the selection property must be forced to a string (e.g. via new String(selection)) when used or you can get some JavaScript errors since the framework tries to parse out a path like 3.2.5.9.13. --- src/client/extras/Sync.Menu.js | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 src/client/extras/Sync.Menu.js diff --git a/src/client/extras/Sync.Menu.js b/src/client/extras/Sync.Menu.js old mode 100644 new mode 100755 index 9045b2e0..e4ed1461 --- a/src/client/extras/Sync.Menu.js +++ b/src/client/extras/Sync.Menu.js @@ -582,6 +582,8 @@ Extras.Sync.Menu.RenderedMenu = Core.extend({ foreground = this.component.render("foreground", Extras.Sync.Menu.DEFAULTS.foreground); } Echo.Sync.Color.render(foreground, menuContentDiv, "color"); + Echo.Sync.Extent.render(this.component.render("menuWidth"), + menuContentDiv, "width", true, false); // Apply menu font if it is set, or apply default font // if it is set and the menu font is NOT set. @@ -627,6 +629,7 @@ Extras.Sync.Menu.RenderedMenu = Core.extend({ var menuTable = document.createElement("table"); menuTable.style.borderCollapse = "collapse"; + menuTable.style.width = "100%"; menuContentDiv.appendChild(menuTable); var menuTbody = document.createElement("tbody"); @@ -665,6 +668,7 @@ Extras.Sync.Menu.RenderedMenu = Core.extend({ if (hasIcons) { menuItemIconTd = document.createElement("td"); Echo.Sync.Insets.render(iconPadding, menuItemIconTd, "padding"); + Echo.Sync.Extent.render("0px", menuItemIconTd, "width", true, false); if (item instanceof Extras.ToggleOptionModel) { var iconIdentifier; var selected = this.stateModel && this.stateModel.isSelected(item.modelId); From 99ff4c066009b63e7961ef307cbca6b6407e1e4b Mon Sep 17 00:00:00 2001 From: Benjamin Schmid Date: Mon, 27 Feb 2012 13:21:11 +0100 Subject: [PATCH 2/2] Extras.DropDownMenu font rendering Patch provided by ScoPi http://echo.nextapp.com/site/node/6714 This changes makes it so at least the Extras.DropDownMenu renders any font applied to it; previously, it would only render the "menuFont" in the drop down menu itself. Tested in IE 9 and the latest Firefox. --- src/client/extras/Sync.Menu.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/extras/Sync.Menu.js b/src/client/extras/Sync.Menu.js index e4ed1461..58e2a785 100755 --- a/src/client/extras/Sync.Menu.js +++ b/src/client/extras/Sync.Menu.js @@ -1184,6 +1184,7 @@ Extras.Sync.DropDownMenu = Core.extend(Extras.Sync.Menu, { this._contentDiv.style.whiteSpace = "nowrap"; } Echo.Sync.Insets.render(this.component.render("insets", "2px 5px"), this._contentDiv, "padding"); + Echo.Sync.Font.render(this.component.render("font"), this._contentDiv); dropDownDiv.appendChild(this._contentDiv); var clearDiv = document.createElement("div");