Skip to content

Commit

Permalink
Avoid default options to be override by the first modal to override them
Browse files Browse the repository at this point in the history
  • Loading branch information
maxailloud committed Mar 3, 2016
1 parent 2404c6d commit 8bf888c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions confirm-bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
confirmDismiss : true,
confirmAutoOpen : false
};
var options = $.extend(defaultOptions, opts);

var headModalTemplate =
'<div class="modal fade" id="#modalId#" tabindex="-1" role="dialog" aria-labelledby="#AriaLabel#" aria-hidden="true">' +
Expand All @@ -54,12 +53,14 @@
'</div>'
;

return this.each(function(index)
return this.each(function()
{
var options = $.extend({}, defaultOptions, opts);

var confirmLink = $(this);
var targetData = confirmLink.data();

var currentOptions = $.extend(options, targetData);
$.extend(options, targetData);

var modalId = "confirmModal" + Math.floor(Math.random()*(1e+9));
var modalTemplate = headModalTemplate;
Expand Down

0 comments on commit 8bf888c

Please sign in to comment.