Sha256: ae4713c744020ee0b2c1d3eefdb2c3d5c4cd51518e9a5e52e7157a8a0862cc34
Contents?: true
Size: 1.09 KB
Versions: 58
Compression:
Stored size: 1.09 KB
Contents
pageflow.hideText = (function() { function element() { return $('body'); } function prefix(event) { return _.map(event.split(' '), function(e) { return 'hidetext' + e; }).join(' '); } $(function() { element().on('keydown', function(event) { if(event.keyCode == 27) { pageflow.hideText.deactivate(); } }); }); return { isActive: function() { return element().hasClass('hideText'); }, toggle: function() { if (this.isActive()) { this.deactivate(); } else { this.activate(); } }, activate: function() { if (!this.isActive()) { element().addClass('hideText'); element().trigger('hidetextactivate'); } }, deactivate: function() { if (this.isActive()) { element().removeClass('hideText'); element().trigger('hidetextdeactivate'); } }, on: function(event, callback) { element().on(prefix(event), callback); }, off: function(event, callback) { element().off(prefix(event), callback); } }; }());
Version data entries
58 entries across 58 versions & 1 rubygems