added an option to tweak the speed with which a sliderWidget minimizes itself. popcorn-port
authorhamidouk
Thu, 01 Dec 2011 12:21:45 +0100
branchpopcorn-port
changeset 372 33a435f35597
parent 371 3da43513e638
child 373 0e571ced5bc4
added an option to tweak the speed with which a sliderWidget minimizes itself.
src/js/site.js
src/js/widgets/sliderWidget.js
--- a/src/js/site.js	Thu Dec 01 12:08:19 2011 +0100
+++ b/src/js/site.js	Thu Dec 01 12:21:45 2011 +0100
@@ -25,6 +25,9 @@
   "TweetsWidget" : {
       default_profile_picture : "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png",
       tweet_display_period: 10000 // how long do we show a tweet ?
+  },
+  "SliderWidget" : {
+      minimize_period: 850 // how long does the slider stays maximized after the user leaves the zone ?
   }
 };
 
--- a/src/js/widgets/sliderWidget.js	Thu Dec 01 12:08:19 2011 +0100
+++ b/src/js/widgets/sliderWidget.js	Thu Dec 01 12:21:45 2011 +0100
@@ -107,8 +107,9 @@
 
 /* handles when the mouse leaves the slider */
 IriSP.SliderWidget.prototype.mouseOutHandler = function(event) {
- 
-  this.timeOutId = window.setTimeout(IriSP.wrap(this, this.minimizeOnTimeout), 3000);
+
+  this.timeOutId = window.setTimeout(IriSP.wrap(this, this.minimizeOnTimeout),
+                                     IriSP.widgetsDefaults.SliderWidget.minimize_period);
 };
 
 IriSP.SliderWidget.prototype.minimizeOnTimeout = function(event) {