summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/source
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/source')
-rw-r--r--framework/Web/Javascripts/source/packages.php3
-rw-r--r--framework/Web/Javascripts/source/prado/controls/slider.js28
2 files changed, 30 insertions, 1 deletions
diff --git a/framework/Web/Javascripts/source/packages.php b/framework/Web/Javascripts/source/packages.php
index 66b63966..03e237de 100644
--- a/framework/Web/Javascripts/source/packages.php
+++ b/framework/Web/Javascripts/source/packages.php
@@ -47,7 +47,8 @@ $packages = array(
),
'slider'=>array(
- 'scriptaculous/slider.js'
+ 'scriptaculous/slider.js',
+ 'prado/controls/slider.js'
),
'keyboard'=>array(
diff --git a/framework/Web/Javascripts/source/prado/controls/slider.js b/framework/Web/Javascripts/source/prado/controls/slider.js
new file mode 100644
index 00000000..203d95ed
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/controls/slider.js
@@ -0,0 +1,28 @@
+Prado.WebUI.TSlider = Class.extend(Prado.WebUI.PostBackControl,
+{
+ onInit : function (options)
+ {
+ this.options=options;
+ this.onChange=options.onChange;
+ options.onChange=this.change.bind(this);
+
+ this.hiddenField=$(this.options.ID+'_1');
+ new Control.Slider(options.ID+'_handle',options.ID, options);
+
+ if(this.options['AutoPostBack']==true)
+ Event.observe(this.hiddenField, "change", Prado.PostBack.bindEvent(this,options));
+ },
+
+ change : function (v)
+ {
+ this.hiddenField.value=v;
+ if (this.onChange)
+ {
+ this.onChange(v);
+ }
+ if(this.options['AutoPostBack']==true)
+ {
+ Event.fireEvent(this.hiddenField, "change");
+ }
+ }
+}); \ No newline at end of file