Skip to content

Instantly share code, notes, and snippets.

@talves
Forked from markmarijnissen/ShowModifier.js
Created August 21, 2014 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talves/6365b4a91dd0fe9cbd23 to your computer and use it in GitHub Desktop.
Save talves/6365b4a91dd0fe9cbd23 to your computer and use it in GitHub Desktop.
var Transform = require('famous/core/Transform');
function ShowModifier(options) {
this.visible = !!options.visible;
this._output = {
transform: Transform.identity,
opacity: 1,
origin: null,
align: null,
size: null,
target: null
};
}
ShowModifier.prototype.modify = function(target){
this._output.target = this.visible? target: null;
return this._output;
};
ShowModifier.prototype.show = function show(){
this.visible = true;
};
ShowModifier.prototype.hide = function hide() {
this.visible = false;
};
module.exports = ShowModifier;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment