summaryrefslogtreecommitdiff
path: root/framework/Web
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web')
-rwxr-xr-xframework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js6
-rw-r--r--framework/Web/Javascripts/source/prado/datepicker/datepicker.js19
2 files changed, 18 insertions, 7 deletions
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
index 8857ee05..2ee97266 100755
--- a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
@@ -87,5 +87,11 @@ Prado.WebUI.TActiveDatePicker = Class.extend(Prado.WebUI.TDatePicker,
// Make callback request
var request = new Prado.CallbackRequest(this.options.EventTarget,this.options);
request.dispatch();
+ },
+
+ // reimplement parent method to avoid handling mouse whell events,
+ // since they can cause floods of callback events
+ mouseWheelChange : function (event)
+ {
}
});
diff --git a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
index 8105823a..95ab43e7 100644
--- a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
+++ b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
@@ -303,8 +303,10 @@ Prado.WebUI.TDatePicker.prototype =
Event.observe(this._monthSelect, "change", this.monthSelect.bindEvent(this));
Event.observe(this._yearSelect, "change", this.yearSelect.bindEvent(this));
- // ie6 extension
+ // ie, opera
Event.observe(this._calDiv, "mousewheel", this.mouseWheelChange.bindEvent(this));
+ // ff
+ Event.observe(this._calDiv, "DOMMouseScroll", this.mouseWheelChange.bindEvent(this));
Event.observe(calendarBody, "click", this.selectDate.bindEvent(this));
@@ -448,15 +450,18 @@ Prado.WebUI.TDatePicker.prototype =
this.setYear(Form.Element.getValue(Event.element(ev)));
},
- // ie6 extension
- mouseWheelChange : function (e)
+ mouseWheelChange : function (event)
{
- if (e == null) e = document.parentWindow.event;
- var n = - e.wheelDelta / 120;
+ var delta = 0;
+ if (!event) event = document.parentWindow.event;
+ if (event.wheelDelta) {
+ delta = event.wheelDelta/120;
+ if (window.opera) delta = -delta;
+ } else if (event.detail) { delta = -event.detail/3; }
+
var d = this.newDate(this.selectedDate);
- var m = d.getMonth() + n;
+ var m = d.getMonth() + Math.round(delta);
this.setMonth(m);
-
return false;
},