Skip to content

Instantly share code, notes, and snippets.

@ondrek
Last active August 29, 2015 14:01
Show Gist options
  • Save ondrek/2869175035e152ca0b60 to your computer and use it in GitHub Desktop.
Save ondrek/2869175035e152ca0b60 to your computer and use it in GitHub Desktop.
var DomSprite = function(element, properties){
this.properties = properties || {};
this.element = element;
}
goog.inherits(DomSprite, goog.events.EventTarget);
DomSprite.prototype.getAttribute = function(attr){
return this.element.getAttribute(attr);
};
DomSprite.prototype.setAttribute = function(name, value){
console.log(this.element, "has new attr", name, value);
this.element.setAttribute(name, value);
};
DomSprite.prototype.showElement = function(optDisplayValue){
if (!optDisplayValue){ optDisplayValue = "block"; }
goog.style.setStyle( this.element, "display", optDisplayValue );
};
DomSprite.prototype.hideElement = function(){
goog.style.setStyle( this.element, "display", "none" );
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment