summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/source
diff options
context:
space:
mode:
authortof <>2007-09-04 08:56:24 +0000
committertof <>2007-09-04 08:56:24 +0000
commit918ed9fd995cc3e958bb0d48c8d234717facf181 (patch)
tree7638b6194cb5af299b6c619463e7497456affed4 /framework/Web/Javascripts/source
parent7d27d36860395c140557f415bcde52679fab9e2a (diff)
Merge TSlider component from 3.2-dev branch.
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