Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pushed new branch

git-svn-id: https://calendardateselect.googlecode.com/svn/tags/RELEASE_1_9_1@274 4972a71b-da31-0410-b7dd-373b726a5e75
  • Loading branch information...
commit 4d2dc4747f0ba062d4ea17122b5547b7d99f5d94 2 parents 0a31cbc + 36349f2
timcharper authored
View
1  CHANGELOG
@@ -3,6 +3,7 @@ Nov 15, 2007
* Removed dependency on deprecated features in 1.6.0. Thanks again, Richard Quadling!
* Bugfix - was showing wrong day selected when selecting Mar 23, 2008. (Day light savings time issue). Fixed with test case.
* Added CSS style to show red border around the embedded calendar_date_select div's with errors.
+ * Callbacks were broken with 1.9.0. Fixed, added test cases.
==Version 1.9.0==
Nov 13, 2007
View
22 js_test/functional/cds_test.html
@@ -103,6 +103,28 @@
assertEqual(5, cds.date.getMonth())
cds.close();
}},
+ test_callBacks: function() { with(this){
+ $("cds_test").up().build("div", {id: "global"});
+ cds = new CalendarDateSelect($("cds_test"), {time: "mixed",
+ before_show: function() { $("global").before_show = true},
+ after_show: function() { $("global").after_show = true},
+ before_close: function() { $("global").before_close = true},
+ after_close: function() { $("global").after_close = true},
+ after_navigate: function() { $("global").after_navigate = true},
+ onchange: function() { $("global").onchange = true},
+ });
+ cds.navMonth(1);
+ cds.navMonth(10);
+ cds.updateSelectedDate({month: 1, day: 1, year: 2007});
+ cds.close();
+ assert($('global').before_show, "before_show wasnt called");
+ assert($('global').after_show, "after_show wasnt called");
+ assert($('global').before_close, "before_close wasnt called");
+ assert($('global').after_close, "after_close wasnt called");
+ assert($('global').after_navigate, "after_navigate wasnt called");
+ assert($('global').onchange, "onchange wasnt called");
+ $("global").remove();
+ }},
test_disabledElement_cantUpdate: function() {with(this){
$("cds_test").value = "May 10, 2007";
$("cds_test").disabled = true;
View
2  public/javascripts/calendar_date_select/calendar_date_select.js
@@ -429,5 +429,5 @@ CalendarDateSelect.prototype = {
keyPress: function(e) {
if (e.keyCode==Event.KEY_ESC) this.close();
},
- callback: function(name, param) { if (this.options[name]) { this.options[name].bind(this.target_element)(param); } }
+ callback: function(name, param) { if (this.options.get(name)) { this.options.get(name).bind(this.target_element)(param); } }
}
Please sign in to comment.
Something went wrong with that request. Please try again.