diff --git a/CHANGES.rst b/CHANGES.rst index 26ed1ab38..9cb139aec 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -50,6 +50,15 @@ New features: Bug fixes: +- modal: Fixed duplicate window.confirm on form unload. + Fixes `issue 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 `_. + [seanupton] + - In the insert link/image modal, pass use the correct related items widget options from the ``linkModal`` attribute. [thet] diff --git a/mockup/patterns/formunloadalert/pattern.js b/mockup/patterns/formunloadalert/pattern.js index 1988efaa2..f79d3992e 100644 --- a/mockup/patterns/formunloadalert/pattern.js +++ b/mockup/patterns/formunloadalert/pattern.js @@ -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 { diff --git a/mockup/patterns/modal/pattern.js b/mockup/patterns/modal/pattern.js index 21673a4fc..c3dbadea1 100644 --- a/mockup/patterns/modal/pattern.js +++ b/mockup/patterns/modal/pattern.js @@ -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');