Created
February 4, 2013 23:49
-
-
Save tivac/4710846 to your computer and use it in GitHub Desktop.
Y.App doesn't stick classes onto view containers by default, which seems kinda bonkers to me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jshint browser:true, yui:true */ | |
YUI.add("extension-view-classer", function(Y) { | |
"use strict"; | |
var ViewClasser = function() {}; | |
ViewClasser.prototype = { | |
initializer : function() { | |
this._viewClasserHandle = Y.Do.before(this._addViewClasses, this, "render", this); | |
}, | |
destructor : function() { | |
this._viewClasserHandle.detach(); | |
}, | |
_addViewClasses : function() { | |
var css = "view " + this.name.toLowerCase() + " " + (this.css || ""); | |
this.get("container").addClass(css); | |
} | |
}; | |
Y.namespace("GW2.Extensions").ViewClasser = ViewClasser; | |
}, "@VERSION@", { | |
requires : [ | |
"node", | |
"event-custom-base" | |
] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment