Skip to content

Commit

Permalink
优化 增加picker的onClose回调
Browse files Browse the repository at this point in the history
  • Loading branch information
BearJ committed Nov 8, 2017
1 parent b4e3a77 commit 84a75f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ document.querySelector('#multiPickerBtn').addEventListener('click', function ()
onConfirm: function (result) {
console.log(result);
},
id: 'multiPickerBtn'
id: 'multiPickerBtn',
onClose: function(){
console.log('onClose');
}
});
});

Expand Down
4 changes: 3 additions & 1 deletion src/picker/picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ function picker() {
className: '',
container: 'body',
onChange: $.noop,
onConfirm: $.noop
onConfirm: $.noop,
onClose: $.noop
}, options);

// 数据处理
Expand Down Expand Up @@ -236,6 +237,7 @@ function picker() {
.on('animationend webkitAnimationEnd', function () {
$picker.remove();
_sington = false;
options.onClose && options.onClose();
callback && callback();
});
}
Expand Down

0 comments on commit 84a75f2

Please sign in to comment.