Skip to content

Commit

Permalink
Call onchange callback when clearing the calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
timcharper committed Nov 30, 2008
1 parent b752708 commit 9443fb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions History.txt
Expand Up @@ -5,6 +5,7 @@
* Backwards compatibility hook for Rails 2.1
* RDOC!
* Don't try to focus a hidden or disabled element (closes #129 - thanks Bruno)
* Call onchange callback when clearing the calendar (closes #137 - thanks Chewi)

== Version 1.12 ==
* Updated for compatibility with Rails 2.2
Expand Down
Expand Up @@ -345,9 +345,11 @@ CalendarDateSelect.prototype = {
updateFooter:function(text) { if (!text) text = this.dateString(); this.footer_div.purgeChildren(); this.footer_div.build("span", {innerHTML: text }); },
clearDate:function() {
if ((this.target_element.disabled || this.target_element.readOnly) && this.options.get("popup") != "force") return false;
var last_value = this.target_element.value;
this.target_element.value = "";
this.clearSelectedClass();
this.updateFooter(' ');
if (last_value!=this.target_element.value) this.callback("onchange");
},
updateSelectedDate:function(partsOrElement, via_click) {
var parts = $H(partsOrElement);
Expand Down

0 comments on commit 9443fb7

Please sign in to comment.