# HG changeset patch # User hamidouk # Date 1326378830 -3600 # Node ID 2abc7d900f5e38969866dd068fbb59767c28b6f2 # Parent 79c9a05ddaed663fecb75ab7f683dc24f37630d7 show or hide the widget. diff -r 79c9a05ddaed -r 2abc7d900f5e src/js/widgets/sliceWidget.js --- a/src/js/widgets/sliceWidget.js Thu Jan 12 15:33:34 2012 +0100 +++ b/src/js/widgets/sliceWidget.js Thu Jan 12 15:33:50 2012 +0100 @@ -36,9 +36,16 @@ this._Popcorn.listen("IriSP.SliceWidget.position", IriSP.wrap(this, this.positionSliceHandler)); - this._Popcorn.trigger("IriSP.SliceWidget.position", [57, 24]); + + this._Popcorn.listen("IriSP.SliceWidget.show", IriSP.wrap(this, this.show)); + this._Popcorn.listen("IriSP.SliceWidget.hide", IriSP.wrap(this, this.hide)); + this.selector.hide(); }; +/** responds to an "IriSP.SliceWidget.position" message + @param params an array with the first element being the left distance in + percents and the second element the width of the slice in pixels +*/ IriSP.SliceWidget.prototype.positionSliceHandler = function(params) { left = params[0]; width = params[1]; @@ -107,4 +114,12 @@ var zonePercent = (this.zoneWidth / this.selector.width()) * 100; this._Popcorn.trigger("IriSP.SliceWidget.zoneChange", [leftPercent, zonePercent]); +}; + +IriSP.SliceWidget.prototype.show = function() { + this.selector.show(); +}; + +IriSP.SliceWidget.prototype.hide = function() { + this.selector.hide(); }; \ No newline at end of file