Skip to content

Instantly share code, notes, and snippets.

@tivac
Created February 4, 2013 23:49
Show Gist options
  • Save tivac/4710846 to your computer and use it in GitHub Desktop.
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
/*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