Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Make goog.ui.SubMenu.positionSubMenu_ public, so client code can call…

… it when

mutating a menu.

The reason we want to call this method is that we expand the menu asynchronously when showing the web clipboard, and after having added a menu item and making the menu visible, we add more items. i.e. we show the static menu items, then after showing the menu, show the clipnboard items as the result of a remote class. In the case that the additional menu items are too large to display simply, they will be hidden by the parent menu. So, we need to call positionSubMenu so that the sub menu items are aligned correctly.

R=chrishenry
DELTA=5 (1 added, 0 deleted, 4 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=6067


git-svn-id: http://closure-library.googlecode.com/svn/trunk@2412 0b95b8e8-c90f-11de-9d4f-f947ee5921c8
  • Loading branch information...
commit a085d3977c22f0cbe94a1851d128af395cea1a49 1 parent cae70d8
jpalm@google.com authored

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. +5 4 closure/goog/ui/submenu.js
9 closure/goog/ui/submenu.js
@@ -421,7 +421,7 @@ goog.ui.SubMenu.prototype.setSubMenuVisible_ = function(visible) {
421 421 // We must position after the menu is visible, otherwise positioning logic
422 422 // breaks in RTL.
423 423 if (visible) {
424   - this.positionSubMenu_();
  424 + this.positionSubMenu();
425 425 }
426 426 }
427 427 };
@@ -475,10 +475,11 @@ goog.ui.SubMenu.prototype.isAlignedToEnd = function() {
475 475
476 476
477 477 /**
478   - * Positions the submenu.
479   - * @private
  478 + * Positions the submenu. This method should be called if the sub menu is
  479 + * opened and the menu element's size changes (e.g., when adding/removing items
  480 + * to an opened sub menu).
480 481 */
481   -goog.ui.SubMenu.prototype.positionSubMenu_ = function() {
  482 +goog.ui.SubMenu.prototype.positionSubMenu = function() {
482 483 var position = new goog.positioning.AnchoredViewportPosition(
483 484 this.getElement(), this.isAlignedToEnd() ?
484 485 goog.positioning.Corner.TOP_END : goog.positioning.Corner.TOP_START,

0 comments on commit a085d39

Please sign in to comment.
Something went wrong with that request. Please try again.