Permalink
Browse files

goog.getCssName usage fixes

Fixes issue 259
Contributed by Ilia Mirkin



Revision created by MOE tool push_codebase.

R=pupius
DELTA=42  (21 added, 0 deleted, 21 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=270


git-svn-id: http://closure-library.googlecode.com/svn/trunk@612 0b95b8e8-c90f-11de-9d4f-f947ee5921c8
  • Loading branch information...
1 parent b6b7c99 commit 9a85e497d3233b242534b4adf619597fb9949205 nicksantos@google.com committed Jan 13, 2011
View
@@ -8,3 +8,4 @@ Mohamed Mansour <hello@mohamedmansour.com>
Bjorn Tipling <bjorn.tipling@gmail.com>
SameGoal LLC <help@samegoal.com>
Guido Tapia <guido.tapia@gmail.com>
+Ilia Mirkin <ibmirkin@gmail.com>
@@ -593,8 +593,8 @@ goog.testing.MultiTestRunner.prototype.createDom = function() {
el.appendChild(this.statsEl_);
this.logTabEl_ = this.dom_.createDom('div', null, 'Log');
- this.logTabEl_.className =
- goog.getCssName('goog-testrunner-logtab goog-testrunner-activetab');
+ this.logTabEl_.className = goog.getCssName('goog-testrunner-logtab') + ' ' +
+ goog.getCssName('goog-testrunner-activetab');
el.appendChild(this.logTabEl_);
this.reportTabEl_ = this.dom_.createDom('div', null, 'Report');
@@ -119,11 +119,15 @@ goog.ui.style.app.ButtonRenderer.prototype.createButton = function(content,
dom) {
var baseClass = this.getStructuralCssClass();
var inlineBlock = goog.ui.INLINE_BLOCK_CLASSNAME + ' ';
- return dom.createDom('div', inlineBlock + baseClass + '-outer-box',
- dom.createDom('div', inlineBlock + baseClass + '-inner-box',
- dom.createDom('div', baseClass + '-pos',
- dom.createDom('div', baseClass + '-top-shadow', '\u00A0'),
- dom.createDom('div', baseClass + '-content', content))));
+ return dom.createDom(
+ 'div', inlineBlock + goog.getCssName(baseClass, 'outer-box'),
+ dom.createDom(
+ 'div', inlineBlock + goog.getCssName(baseClass, 'inner-box'),
+ dom.createDom('div', goog.getCssName(baseClass, 'pos'),
+ dom.createDom(
+ 'div', goog.getCssName(baseClass, 'top-shadow'), '\u00A0'),
+ dom.createDom(
+ 'div', goog.getCssName(baseClass, 'content'), content))));
};
@@ -139,25 +143,26 @@ goog.ui.style.app.ButtonRenderer.prototype.createButton = function(content,
goog.ui.style.app.ButtonRenderer.prototype.hasBoxStructure = function(
button, element) {
// TODO(nicksantos): should this use goog.dom.classes?
+ var baseClass = this.getStructuralCssClass();
var outer = button.getDomHelper().getFirstElementChild(element);
if (outer &&
outer.className.indexOf(
- goog.getCssName('goog-button-base-outer-box')) != -1) {
+ goog.getCssName(baseClass, 'outer-box')) != -1) {
var inner = button.getDomHelper().getFirstElementChild(outer);
if (inner &&
inner.className.indexOf(
- goog.getCssName('goog-button-base-inner-box')) != -1) {
+ goog.getCssName(baseClass, 'inner-box')) != -1) {
var pos = button.getDomHelper().getFirstElementChild(inner);
if (pos &&
pos.className.indexOf(
- goog.getCssName('goog-button-base-pos')) != -1) {
+ goog.getCssName(baseClass, 'pos')) != -1) {
var shadow = button.getDomHelper().getFirstElementChild(pos);
if (shadow && shadow.className.indexOf(
- goog.getCssName('goog-button-base-top-shadow')) != -1) {
+ goog.getCssName(baseClass, 'top-shadow')) != -1) {
var content = button.getDomHelper().getNextElementSibling(shadow);
if (content &&
content.className.indexOf(
- goog.getCssName('goog-button-base-content')) != -1) {
+ goog.getCssName(baseClass, 'content')) != -1) {
// We have a proper box structure.
return true;
}
@@ -51,7 +51,8 @@ goog.addSingletonGetter(goog.ui.style.app.MenuButtonRenderer);
* by this renderer.
* @type {string}
*/
-goog.ui.style.app.MenuButtonRenderer.CSS_CLASS = 'goog-menu-button';
+goog.ui.style.app.MenuButtonRenderer.CSS_CLASS =
+ goog.getCssName('goog-menu-button');
/**
@@ -61,13 +62,27 @@ goog.ui.style.app.MenuButtonRenderer.CSS_CLASS = 'goog-menu-button';
* @type {Array.<Array.<string>>}
*/
goog.ui.style.app.MenuButtonRenderer.IE6_CLASS_COMBINATIONS = [
- ['goog-button-base-rtl', 'goog-menu-button'],
- ['goog-button-base-hover', 'goog-menu-button'],
- ['goog-button-base-focused', 'goog-menu-button'],
- ['goog-button-base-disabled', 'goog-menu-button'],
- ['goog-button-base-active', 'goog-menu-button'],
- ['goog-button-base-open', 'goog-menu-button'],
- ['goog-button-base-active', 'goog-button-base-open', 'goog-menu-button']
+ [goog.getCssName('goog-button-base-rtl'),
+ goog.getCssName('goog-menu-button')],
+
+ [goog.getCssName('goog-button-base-hover'),
+ goog.getCssName('goog-menu-button')],
+
+ [goog.getCssName('goog-button-base-focused'),
+ goog.getCssName('goog-menu-button')],
+
+ [goog.getCssName('goog-button-base-disabled'),
+ goog.getCssName('goog-menu-button')],
+
+ [goog.getCssName('goog-button-base-active'),
+ goog.getCssName('goog-menu-button')],
+
+ [goog.getCssName('goog-button-base-open'),
+ goog.getCssName('goog-menu-button')],
+
+ [goog.getCssName('goog-button-base-active'),
+ goog.getCssName('goog-button-base-open'),
+ goog.getCssName('goog-menu-button')]
];
@@ -191,7 +206,7 @@ goog.ui.style.app.MenuButtonRenderer.prototype.createContentWithDropdown =
* @return {Element} Dropdown element.
*/
goog.ui.style.app.MenuButtonRenderer.prototype.createDropdown = function(dom) {
- return dom.createDom('div', this.getCssClass() + '-dropdown');
+ return dom.createDom('div', goog.getCssName(this.getCssClass(), 'dropdown'));
};

0 comments on commit 9a85e49

Please sign in to comment.