Skip to content

Commit

Permalink
Merge pull request #50 from aaronjensen/patch-1
Browse files Browse the repository at this point in the history
Take options in close
  • Loading branch information
samdark committed Oct 15, 2014
2 parents d229785 + 8fff83f commit 3d278e6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions jquery.the-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,10 @@
localOptions.onOpen(overlay, localOptions);
}
},
close: function() {
var el = els.get(0);

var localOptions = $.extend({}, defaults, options);
close: function(options) {
var el = els.get(0),
localOptions = $.extend({}, defaults, $(el).data(pluginNamespace+'.options'), options);
var overlay = $('.' + localOptions.overlayClass);
$.extend(localOptions, overlay.data(pluginNamespace+'.options'));

if ($.isFunction(localOptions.onBeforeClose)) {
if (localOptions.onBeforeClose(overlay, localOptions) === false) {
Expand Down

0 comments on commit 3d278e6

Please sign in to comment.