| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 19 | 2 | 2 | 0.975 | ExpressionStatement |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 19 | 128 | Closure/closure/goog/ui/menubuttonrenderer.js |
| 2 | 20 | 124 | 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.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);
} ;
|
| ||||
/**
* 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);
} ;
|
| |||
[[#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 Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#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 |
| 1 | 2 | [[#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 |
| 2 | 1 | [[#5c0c6b80]] | ui |
| 2 | 2 | [[#5c0c6b80]] | app |