CloneSet174


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
19220.975ExpressionStatement
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
119128
Closure/closure/goog/ui/menubuttonrenderer.js
220124
Closure/closure/goog/ui/style/app/menubuttonrenderer.js
Clone Instance
1
Line Count
19
Source Line
128
Source File
Closure/closure/goog/ui/menubuttonrenderer.js

/**
 * Takes an element, decorates it with the menu button control, and returns
 * the element.  Overrides {@link goog.ui.CustomButtonRenderer#decorate} by
 * looking for a child element that can be decorated by a menu, and if it
 * finds one, decorates it and attaches it to the menu button.
 * @param {goog.ui.MenuButton} button Menu button to decorate the element.
 * @param {Element} element Element to decorate.
 * @return {Element} Decorated element.
 */
goog.ui.MenuButtonRenderer.prototype.decorate=  function (button, element){
  // TODO:  Add more robust support for subclasses of goog.ui.Menu.
  var menuElem=  goog.dom.getElementsByTagNameAndClass(
      '*', goog.ui.MenuRenderer.CSS_CLASS, element)[0];
  if (menuElem) {
    // Move the menu element directly under the body (but hide it first to
    // prevent flicker; see bug 1089244).
    goog.style.showElement(menuElem, false);
    goog.dom.appendChild(goog.dom.getOwnerDocument(menuElem).body, menuElem);

    // Decorate the menu and attach it to the button.
    var menu=  new goog.ui.Menu( );
    menu.decorate(menuElem);
    button.setMenu(menu);
                }

  // Let the superclass do the rest.
  return goog.ui.MenuButtonRenderer.superClass_.decorate.call(this, button,
      element);
                                                                          } ;


Clone Instance
2
Line Count
20
Source Line
124
Source File
Closure/closure/goog/ui/style/app/menubuttonrenderer.js

/**
 * Takes an element, decorates it with the menu button control, and returns
 * the element.  Overrides {@link goog.ui.style.app.ButtonRenderer#decorate} by
 * looking for a child element that can be decorated by a menu, and if it
 * finds one, decorates it and attaches it to the menu button.
 * @param {goog.ui.MenuButton} button Menu button to decorate the element.
 * @param {Element} element Element to decorate.
 * @return {Element} Decorated element.
 */
goog.ui.style.app.MenuButtonRenderer.prototype.decorate=  function (button,
     element){
  // TODO:  Add more robust support for subclasses of goog.ui.Menu.
  var menuElem=  goog.dom.getElementsByTagNameAndClass(
      '*', goog.ui.MenuRenderer.CSS_CLASS, element)[0];
  if (menuElem) {
    // Move the menu element directly under the body (but hide it first to
    // prevent flicker; see bug 1089244).
    goog.style.showElement(menuElem, false);
    goog.dom.appendChild(goog.dom.getOwnerDocument(menuElem).body, menuElem);

    // Decorate the menu and attach it to the button.
    var menu=  new goog.ui.Menu( );
    menu.decorate(menuElem);
    button.setMenu(menu);
                }

  // Let the superclass do the rest.
  return goog.ui.style.app.MenuButtonRenderer.superClass_.decorate.call(this,
      button, element);
             } ;


Clone AbstractionParameter Count: 2Parameter Bindings

 [[#variable61a235c0]]. [[#variable5c0c6b80]].MenuButtonRenderer.prototype.decorate= function (button,element)
                                                                                     {
                                                                                       // TODO:  Add more robust support for subclasses of goog.ui.Menu.
                                                                                       var menuElem=goog.dom.getElementsByTagNameAndClass('*',goog.ui.MenuRenderer.CSS_CLASS,element)[0];
                                                                                       if (menuElem)
                                                                                         {
                                                                                           // Move the menu element directly under the body (but hide it first to
                                                                                           // prevent flicker; see bug 1089244).
                                                                                           goog.style.showElement(menuElem, false);
                                                                                           goog.dom.appendChild(goog.dom.getOwnerDocument(menuElem).body,menuElem);
                                                                                           // Decorate the menu and attach it to the button.
                                                                                           var menu=new goog.ui.Menu( );
                                                                                           menu.decorate(menuElem);
                                                                                           button.setMenu(menu);
                                                                                         }
                                                                                       // Let the superclass do the rest.
                                                                                       return [[#variable61a235c0]]. [[#variable5c0c6b80]].MenuButtonRenderer.superClass_.decorate.call(this,button,element);
                                                                                     } ;
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#61a235c0]]
/**
 * Takes an element, decorates it with the menu button control, and returns
 * the element.  Overrides {@link goog.ui.CustomButtonRenderer#decorate} by
 * looking for a child element that can be decorated by a menu, and if it
 * finds one, decorates it and attaches it to the menu button.
 * @param {goog.ui.MenuButton} button Menu button to decorate the element.
 * @param {Element} element Element to decorate.
 * @return {Element} Decorated element.
 */
goog 
12[[#61a235c0]]
/**
 * Takes an element, decorates it with the menu button control, and returns
 * the element.  Overrides {@link goog.ui.style.app.ButtonRenderer#decorate} by
 * looking for a child element that can be decorated by a menu, and if it
 * finds one, decorates it and attaches it to the menu button.
 * @param {goog.ui.MenuButton} button Menu button to decorate the element.
 * @param {Element} element Element to decorate.
 * @return {Element} Decorated element.
 */
goog.ui.style 
21[[#5c0c6b80]]
ui 
22[[#5c0c6b80]]
app