Author: dmorozov
Date: 2008-07-31 07:52:41 -0400 (Thu, 31 Jul 2008)
New Revision: 9842
Modified:
trunk/ui/dataFilterSlider/src/main/resources/org/richfaces/renderkit/html/scripts/datafilterslider.js
Log:
https://jira.jboss.org/jira/browse/RF-4053
Modified:
trunk/ui/dataFilterSlider/src/main/resources/org/richfaces/renderkit/html/scripts/datafilterslider.js
===================================================================
---
trunk/ui/dataFilterSlider/src/main/resources/org/richfaces/renderkit/html/scripts/datafilterslider.js 2008-07-31
11:37:48 UTC (rev 9841)
+++
trunk/ui/dataFilterSlider/src/main/resources/org/richfaces/renderkit/html/scripts/datafilterslider.js 2008-07-31
11:52:41 UTC (rev 9842)
@@ -11,6 +11,24 @@
Richfaces.DFSControl = {};
Richfaces.DFSControl.Slider = Class.create();
+if (!window.RichShuttleUtils) {
+ window.RichShuttleUtils = {};
+}
+
+Richfaces.DFSControl.execOnLoad = function(func, condition, timeout) {
+
+ if (condition()) {
+ func();
+ } else {
+ window.setTimeout(
+ function() {
+ Richfaces.DFSControl.execOnLoad(func, condition, timeout);
+ },
+ timeout
+ );
+ }
+};
+
// options:
// axis: 'vertical', or 'horizontal' (default)
//
@@ -79,8 +97,16 @@
// Initialize handles in reverse (make sure first handle is active)
this.handles[0].style.visibility="hidden";
-//
http://jira.jboss.com/jira/browse/RF-2830
- Event.observe(window, "load", this.loadEventHandler);
+ Richfaces.DFSControl.execOnLoad(
+ function() {
+ this.initHandles();
+ }.bind(this),
+ function() {
+ return this.handles[0].offsetHeight > 0;
+ }.bind(this),
+ 100);
+
+ //Event.observe(window, "load", this.loadEventHandler);
this.initialized = true;
},