Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Commit

Permalink
Fixed a bug with callbacks props in date picker
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiklaubach committed Apr 26, 2012
1 parent 90d9db1 commit a8b2f28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
@@ -1,3 +1,7 @@
** Version 1.2 - Date 26.04.2012 **

* Fixed a bug with callbacks property in the date picker view

** Version 1.1 - Date 20.04.2012 **

* Fixed Issue #30: Changed button() to buttonMarkup() to render dynamically added buttons correctly
Expand Down
6 changes: 3 additions & 3 deletions modules/ui/date_picker.js
Expand Up @@ -637,7 +637,7 @@ M.DatePickerView = M.View.extend(
}

/* call callback */
if(this.callbacks && M.EventDispatcher.checkHandler(this.callbacks['before'])) {
if(this.callbacks && this.callbacks['before'] && M.EventDispatcher.checkHandler(this.callbacks['before'])) {
M.EventDispatcher.callHandler(this.callbacks['before'], null, NO, [value, date]);
}
},
Expand Down Expand Up @@ -669,9 +669,9 @@ M.DatePickerView = M.View.extend(
}

/* call cancel callback */
if(!this.isValueSelected && this.callbacks && M.EventDispatcher.checkHandler(this.callbacks['cancel'])) {
if(!this.isValueSelected && this.callbacks && this.callbacks['cancel'] && M.EventDispatcher.checkHandler(this.callbacks['cancel'])) {
M.EventDispatcher.callHandler(this.callbacks['cancel'], null, NO, []);
} else if(this.isValueSelected && this.callbacks && M.EventDispatcher.checkHandler(this.callbacks['confirm'])) {
} else if(this.isValueSelected && this.callbacks && this.callbacks['confirm'] && M.EventDispatcher.checkHandler(this.callbacks['confirm'])) {
M.EventDispatcher.callHandler(this.callbacks['confirm'], null, NO, [value, date]);
}

Expand Down

0 comments on commit a8b2f28

Please sign in to comment.