Skip to content

Commit

Permalink
Merge pull request #38 from mrgrain/issue12
Browse files Browse the repository at this point in the history
Call onHide callback when calling colpickHide
  • Loading branch information
josedvq authored Dec 11, 2017
2 parents 3f4e409 + 5e4c280 commit ee25941
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/colpick.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,12 @@ For usage and examples: colpick.com/plugin
cal.mousedown(function(ev){ev.stopPropagation();})
},
hide = function (ev) {
if (ev.data.cal.data('colpick').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
ev.data.cal.hide();
var cal = $('#' + $(this).data('colpickId'));
if (ev) {
cal = ev.data.cal;
}
if (cal.data('colpick').onHide.apply(this, [cal.get(0)]) != false) {
cal.hide();
}
$('html').off('mousedown', hide);
},
Expand Down Expand Up @@ -438,7 +442,7 @@ For usage and examples: colpick.com/plugin
hidePicker: function() {
return this.each( function () {
if ($(this).data('colpickId')) {
$('#' + $(this).data('colpickId')).hide();
hide.apply(this);
}
});
},
Expand Down

0 comments on commit ee25941

Please sign in to comment.