Skip to content

Commit

Permalink
Merge pull request #778 from upiq/master
Browse files Browse the repository at this point in the history
Fix two issues with form modals
  • Loading branch information
jensens authored Jun 17, 2017
2 parents 75dfea5 + d28449d commit 350df36
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ New features:

Bug fixes:

- modal: Fixed duplicate window.confirm on form unload.
Fixes `issue 777 <https://github.com/plone/mockup/issues/777>`_.
[seanupton]

- formunloadalert: Fixed incorrect use of Function.prototype.apply,
when call() was seemingly intended; fixes case where modal close leads to
exception. Fixes `issue 776 <https://github.com/plone/mockup/issues/776>`_.
[seanupton]

- In the insert link/image modal, pass use the correct related items widget options from the ``linkModal`` attribute.
[thet]

Expand Down
2 changes: 1 addition & 1 deletion mockup/patterns/formunloadalert/pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ define([
$modal.data('patternPloneModal').on('hide', function(e) {
var modal = $modal.data('patternPloneModal');
if (modal) {
modal._suppressHide = self._handleUnload.apply(self, e);
modal._suppressHide = self._handleUnload.call(self, e);
}
});
} else {
Expand Down
1 change: 1 addition & 0 deletions mockup/patterns/modal/pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ define([
}
self.$wrapper.remove();
if ($('.plone-modal', $('body')).size() < 1) {
self._suppressHide = undefined;
self.backdrop.hide();
$('body').removeClass('plone-modal-open');
$(window.parent).off('resize.plone-modal.patterns');
Expand Down

0 comments on commit 350df36

Please sign in to comment.