Skip to content

Commit

Permalink
fixed #406: muted clear
Browse files Browse the repository at this point in the history
  • Loading branch information
amsul committed Jul 6, 2014
1 parent 461dbe2 commit c8c8722
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [#442](https://github.com/amsul/pickadate.js/issues/442): Fixed flickering on webkit browsers.
- [#438](https://github.com/amsul/pickadate.js/issues/438): Fixed adding an ID to the hidden element to remain unique.
- [#437](https://github.com/amsul/pickadate.js/issues/437): Added Common JS to UMD.
- [#406](https://github.com/amsul/pickadate.js/issues/406): Allow `clear` method to be `muted`.


## 3.5.2
Expand Down
1 change: 1 addition & 0 deletions _docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [#442]({%= pkg.bugs %}/442): Fixed flickering on webkit browsers.
- [#438]({%= pkg.bugs %}/438): Fixed adding an ID to the hidden element to remain unique.
- [#437]({%= pkg.bugs %}/437): Added Common JS to UMD.
- [#406]({%= pkg.bugs %}/406): Allow `clear` method to be `muted`.


## 3.5.2
Expand Down
2 changes: 1 addition & 1 deletion lib/compressed/picker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {
/**
* Clear the values
*/
clear: function() {
return P.set( 'clear' )
clear: function( options ) {
return P.set( 'clear', null, options )
}, //clear


Expand Down
15 changes: 15 additions & 0 deletions tests/units/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,21 @@ test( 'As muted methods', 1, function() {
picker.set({ select: new Date() }, { muted: true })
})

test( 'Clear as muted', function() {

var picker = this.picker
var called = false

// Bind the callback.
picker.on('set', function() {
called = true
})

picker.clear({ muted: true })

ok( !called, 'Callback not called' )
})

test( 'Open with alternate focus', function() {

var picker = this.picker,
Expand Down

0 comments on commit c8c8722

Please sign in to comment.