diff --git a/wire/modules/Jquery/JqueryUI/modal.js b/wire/modules/Jquery/JqueryUI/modal.js
index 4b984e59..c4553864 100644
--- a/wire/modules/Jquery/JqueryUI/modal.js
+++ b/wire/modules/Jquery/JqueryUI/modal.js
@@ -188,7 +188,7 @@ function pwModalWindow(href, options, size) {
$iframe.data('settings', settings);
$iframe.load(function() {
if(typeof settings.title == "undefined" || !settings.title) {
- var title = $('').text($iframe.contents().find('title').text()).html();
+ var title = jQuery('').text($iframe.contents().find('title').text()).html();
$iframe.dialog('option', 'title', title);
}
$iframe.contents().find('form').css('-webkit-backface-visibility', 'hidden'); // to prevent jumping
@@ -332,7 +332,8 @@ function pwModalOpenEvent(e) {
if(closeOnLoad) {
// this occurs when item saved and resulting page is loaded
- if($icontents.find(".NoticeError, .NoticeWarning, .ui-state-error").length == 0) {
+ var $errorItems = $icontents.find(".NoticeError, .ui-state-error");
+ if($errorItems.length == 0) {
// if there are no error messages present, close the window
if(typeof Notifications != "undefined") {
var messages = [];
@@ -347,6 +348,9 @@ function pwModalOpenEvent(e) {
}
$iframe.dialog('close');
return;
+ } else {
+ // console.log('error items prevent modal autoclose:');
+ // console.log($errorItems);
}
}
diff --git a/wire/modules/Jquery/JqueryUI/modal.min.js b/wire/modules/Jquery/JqueryUI/modal.min.js
index 0c0b1861..b1c5a45e 100644
--- a/wire/modules/Jquery/JqueryUI/modal.min.js
+++ b/wire/modules/Jquery/JqueryUI/modal.min.js
@@ -1 +1 @@
-var pwModalWindows=[];function pwModalWindowSettings(b){var d=ProcessWire.config.modals[b];if(typeof d=="undefined"){d=ProcessWire.config.modals.medium}d=d.split(",");var a={modal:true,draggable:false,resizable:true,hide:250,show:100,hideOverflow:true,closeOnEscape:false};if(d.length>=4){for(var f=4;f").find(".ui-icon").remove();if(frameElement&&parent.jQuery!="undefined"&&parent.jQuery(".ui-dialog").length){parent.jQuery(".ui-dialog .ui-button").addClass("pw-modal-hidden").hide();parent.jQuery(".ui-dialog-buttonpane").css("margin-top","-10px");jQuery("body").css("overflow","hidden")}},beforeClose:function(g,h){if(parent.jQuery!="undefined"&&parent.jQuery(".ui-dialog").length){if(frameElement){parent.jQuery(".pw-modal-hidden").show();jQuery("body").css("overflow","")}else{if(a.hideOverflow){parent.jQuery("body").css("overflow","")}}}}}}function pwModalWindow(c,j,i){for(var e=0;e<=pwModalWindows.length;e++){var h=pwModalWindows[e];if(h==null){continue}if(h.dialog("isOpen")){continue}h.dialog("destroy").remove();pwModalWindows[e]=null}if(c.indexOf("modal=")>0){var b=c}else{var b=c+(c.indexOf("?")>-1?"&":"?")+"modal=1"}var h=jQuery('');h.attr("id","pw-modal-window-"+(pwModalWindows.length+1));if(typeof i=="undefined"||i.length==0){var i="large"}var f=pwModalWindowSettings(i);if(f==null){alert("Unknown modal setting: "+i);return h}if(typeof j!="undefined"){jQuery.extend(f,j)}h.on("dialogopen",function(k,l){jQuery(document).trigger("pw-modal-opened",{event:k,ui:l})});h.on("dialogclose",function(k,l){jQuery(document).trigger("pw-modal-closed",{event:k,ui:l})});h.dialog(f);h.data("settings",f);h.load(function(){if(typeof f.title=="undefined"||!f.title){var k=$("").text(h.contents().find("title").text()).html();h.dialog("option","title",k)}h.contents().find("form").css("-webkit-backface-visibility","hidden")});var d=0;var g=0;function a(){var n=jQuery(window).width();var l=jQuery(window).height();if(n==d&&l==g){return}var m=i;if(n<=960&&i!="full"&&i!="large"){m="large"}if(n<=700&&i!="full"){m="full"}var o=pwModalWindowSettings(m);var p=h.closest(".ui-dialog");if(p.length>0){var k=p.find(".ui-dialog-buttonpane").outerHeight()+p.find(".ui-dialog-titlebar").outerHeight();o.height-=k}h.dialog("option","width",o.width);h.dialog("option","height",o.height);h.dialog("option","position",o.position);h.width(o.width).height(o.height);d=n;g=l}a();jQuery(window).resize(a);h.refresh=function(){d=0;g=0;a()};h.setButtons=function(k){h.dialog("option","buttons",k);h.refresh()};h.setTitle=function(k){h.dialog("option","title",k)};return h}function pwModalOpenEvent(j){var c=jQuery(this);var a=c.attr("data-autoclose");var l=a!=null;var i=l&&a.length>1?a:"";var h=c.attr("data-close");var k=false;var f="medium";if(c.hasClass("pw-modal-large")){f="large"}else{if(c.hasClass("pw-modal-small")){f="small"}else{if(c.hasClass("pw-modal-full")){f="full"}}}var d={title:c.attr("title"),close:function(p,q){var r=typeof p.toElement!="undefined"&&jQuery(p.toElement).hasClass("fa-times");var e={event:p,ui:q,abort:r};c.trigger("modal-close",e);c.trigger("pw-modal-closed",e);jQuery(document).trigger("pw-modal-closed",e);g.remove()}};var o=c.attr("data-buttons");if(h==null){h=""}h+=(h.length>0?", ":"")+".pw-modal-cancel";var g=jQuery("").css({position:"absolute",top:(parseInt(jQuery(window).height()/2)-80)+"px",left:(parseInt(jQuery(window).width()/2)-20)+"px","z-index":9999}).hide();var b=c.attr("data-pw-modal-href");if(b&&b.length){}else{if(c.is("button")){var m=c.closest("a");b=m.length?m.attr("href"):c.attr("data-href");if(!b){b=c.find("a").attr("href")}}else{if(c.is("a")){b=c.attr("href")}else{b=c.attr("data-href")}}}if(!b){alert("Unable to find href attribute for: "+c.text());return false}var n=pwModalWindow(b,d,f);jQuery("body").append(g.fadeIn("fast"));setTimeout(function(){c.removeClass("ui-state-active")},500);n.load(function(){var p=[];var r=n.contents();var s=0;g.fadeOut("fast",function(){g.remove()});if(k){if(r.find(".NoticeError, .NoticeWarning, .ui-state-error").length==0){if(typeof Notifications!="undefined"){var e=[];r.find(".NoticeMessage").each(function(){e[e.length]=jQuery(this).text()});if(e.length>0){setTimeout(function(){for(var t=0;t0&&v.is(h)){n.dialog("close")}if(l){jQuery("body").append(g.fadeIn());if(i.length>1){k=v.is(i)}else{k=true}}}};s++}if(!v.hasClass("pw-modal-button-visible")){v.hide()}})}if(p.length>0){n.setButtons(p)}q.fadeIn("fast",function(){q.show()})});return false}(function(a){a.event.special.pwdoubletap={bindType:"touchend",delegateType:"touchend",handle:function(e){var d=e.handleObj,f=jQuery.data(e.target),c=new Date().getTime(),g=f.lastTouch?c-f.lastTouch:0,b=b==null?300:b;if(g30){f.lastTouch=null;e.type=d.origType;["clientX","clientY","pageX","pageY"].forEach(function(h){e[h]=e.originalEvent.changedTouches[0][h]});d.handler.apply(this,arguments)}else{f.lastTouch=c}}}})(jQuery);function pwModalDoubleClick(){var b=0,d=null,c=false;jQuery(document).on("click",".pw-modal-dblclick a",function(){var e=jQuery(this);if(c){c=false;return true}b++;if(b===1){d=setTimeout(function(){b=0;c=true;e[0].click();return true},700)}else{clearTimeout(d);c=false;b=0;jQuery(this).closest(".pw-modal-dblclick").trigger("dblclick")}return false});jQuery(document).on("dblclick",".pw-modal-dblclick a",function(f){f.stopPropagation();return false});var a=(("ontouchstart" in window)||(navigator.MaxTouchPoints>0)||(navigator.msMaxTouchPoints>0));if(a){jQuery(document).on("pwdoubletap",".pw-modal-dblclick",pwModalOpenEvent)}}jQuery(document).ready(function(a){a.widget("ui.dialog",a.extend({},a.ui.dialog.prototype,{_title:function(b){if(!this.options.title){b.html(" ")}else{b.html(this.options.title)}}}));a(document).on("pwdblclick",".pw-modal-dblclick",pwModalOpenEvent);a(document).on("click",".pw-modal:not(.pw-modal-dblclick):not(.pw-modal-longclick)",pwModalOpenEvent);a(document).on("dblclick",".pw-modal-dblclick",pwModalOpenEvent);a(document).on("longclick",".pw-modal-longclick",pwModalOpenEvent);pwModalDoubleClick()});
\ No newline at end of file
+var pwModalWindows=[];function pwModalWindowSettings(b){var d=ProcessWire.config.modals[b];if(typeof d=="undefined"){d=ProcessWire.config.modals.medium}d=d.split(",");var a={modal:true,draggable:false,resizable:true,hide:250,show:100,hideOverflow:true,closeOnEscape:false};if(d.length>=4){for(var f=4;f").find(".ui-icon").remove();if(frameElement&&parent.jQuery!="undefined"&&parent.jQuery(".ui-dialog").length){parent.jQuery(".ui-dialog .ui-button").addClass("pw-modal-hidden").hide();parent.jQuery(".ui-dialog-buttonpane").css("margin-top","-10px");jQuery("body").css("overflow","hidden")}},beforeClose:function(g,h){if(parent.jQuery!="undefined"&&parent.jQuery(".ui-dialog").length){if(frameElement){parent.jQuery(".pw-modal-hidden").show();jQuery("body").css("overflow","")}else{if(a.hideOverflow){parent.jQuery("body").css("overflow","")}}}}}}function pwModalWindow(c,j,i){for(var e=0;e<=pwModalWindows.length;e++){var h=pwModalWindows[e];if(h==null){continue}if(h.dialog("isOpen")){continue}h.dialog("destroy").remove();pwModalWindows[e]=null}if(c.indexOf("modal=")>0){var b=c}else{var b=c+(c.indexOf("?")>-1?"&":"?")+"modal=1"}var h=jQuery('');h.attr("id","pw-modal-window-"+(pwModalWindows.length+1));if(typeof i=="undefined"||i.length==0){var i="large"}var f=pwModalWindowSettings(i);if(f==null){alert("Unknown modal setting: "+i);return h}if(typeof j!="undefined"){jQuery.extend(f,j)}h.on("dialogopen",function(k,l){jQuery(document).trigger("pw-modal-opened",{event:k,ui:l})});h.on("dialogclose",function(k,l){jQuery(document).trigger("pw-modal-closed",{event:k,ui:l})});h.dialog(f);h.data("settings",f);h.load(function(){if(typeof f.title=="undefined"||!f.title){var k=jQuery("").text(h.contents().find("title").text()).html();h.dialog("option","title",k)}h.contents().find("form").css("-webkit-backface-visibility","hidden")});var d=0;var g=0;function a(){var n=jQuery(window).width();var l=jQuery(window).height();if(n==d&&l==g){return}var m=i;if(n<=960&&i!="full"&&i!="large"){m="large"}if(n<=700&&i!="full"){m="full"}var o=pwModalWindowSettings(m);var p=h.closest(".ui-dialog");if(p.length>0){var k=p.find(".ui-dialog-buttonpane").outerHeight()+p.find(".ui-dialog-titlebar").outerHeight();o.height-=k}h.dialog("option","width",o.width);h.dialog("option","height",o.height);h.dialog("option","position",o.position);h.width(o.width).height(o.height);d=n;g=l}a();jQuery(window).resize(a);h.refresh=function(){d=0;g=0;a()};h.setButtons=function(k){h.dialog("option","buttons",k);h.refresh()};h.setTitle=function(k){h.dialog("option","title",k)};return h}function pwModalOpenEvent(j){var c=jQuery(this);var a=c.attr("data-autoclose");var l=a!=null;var i=l&&a.length>1?a:"";var h=c.attr("data-close");var k=false;var f="medium";if(c.hasClass("pw-modal-large")){f="large"}else{if(c.hasClass("pw-modal-small")){f="small"}else{if(c.hasClass("pw-modal-full")){f="full"}}}var d={title:c.attr("title"),close:function(p,q){var r=typeof p.toElement!="undefined"&&jQuery(p.toElement).hasClass("fa-times");var e={event:p,ui:q,abort:r};c.trigger("modal-close",e);c.trigger("pw-modal-closed",e);jQuery(document).trigger("pw-modal-closed",e);g.remove()}};var o=c.attr("data-buttons");if(h==null){h=""}h+=(h.length>0?", ":"")+".pw-modal-cancel";var g=jQuery("").css({position:"absolute",top:(parseInt(jQuery(window).height()/2)-80)+"px",left:(parseInt(jQuery(window).width()/2)-20)+"px","z-index":9999}).hide();var b=c.attr("data-pw-modal-href");if(b&&b.length){}else{if(c.is("button")){var m=c.closest("a");b=m.length?m.attr("href"):c.attr("data-href");if(!b){b=c.find("a").attr("href")}}else{if(c.is("a")){b=c.attr("href")}else{b=c.attr("data-href")}}}if(!b){alert("Unable to find href attribute for: "+c.text());return false}var n=pwModalWindow(b,d,f);jQuery("body").append(g.fadeIn("fast"));setTimeout(function(){c.removeClass("ui-state-active")},500);n.load(function(){var q=[];var s=n.contents();var t=0;g.fadeOut("fast",function(){g.remove()});if(k){var e=s.find(".NoticeError, .ui-state-error");if(e.length==0){if(typeof Notifications!="undefined"){var p=[];s.find(".NoticeMessage").each(function(){p[p.length]=jQuery(this).text()});if(p.length>0){setTimeout(function(){for(var u=0;u0&&w.is(h)){n.dialog("close")}if(l){jQuery("body").append(g.fadeIn());if(i.length>1){k=w.is(i)}else{k=true}}}};t++}if(!w.hasClass("pw-modal-button-visible")){w.hide()}})}if(q.length>0){n.setButtons(q)}r.fadeIn("fast",function(){r.show()})});return false}(function(a){a.event.special.pwdoubletap={bindType:"touchend",delegateType:"touchend",handle:function(e){var d=e.handleObj,f=jQuery.data(e.target),c=new Date().getTime(),g=f.lastTouch?c-f.lastTouch:0,b=b==null?300:b;if(g30){f.lastTouch=null;e.type=d.origType;["clientX","clientY","pageX","pageY"].forEach(function(h){e[h]=e.originalEvent.changedTouches[0][h]});d.handler.apply(this,arguments)}else{f.lastTouch=c}}}})(jQuery);function pwModalDoubleClick(){var b=0,d=null,c=false;jQuery(document).on("click",".pw-modal-dblclick a",function(){var e=jQuery(this);if(c){c=false;return true}b++;if(b===1){d=setTimeout(function(){b=0;c=true;e[0].click();return true},700)}else{clearTimeout(d);c=false;b=0;jQuery(this).closest(".pw-modal-dblclick").trigger("dblclick")}return false});jQuery(document).on("dblclick",".pw-modal-dblclick a",function(f){f.stopPropagation();return false});var a=(("ontouchstart" in window)||(navigator.MaxTouchPoints>0)||(navigator.msMaxTouchPoints>0));if(a){jQuery(document).on("pwdoubletap",".pw-modal-dblclick",pwModalOpenEvent)}}jQuery(document).ready(function(a){a.widget("ui.dialog",a.extend({},a.ui.dialog.prototype,{_title:function(b){if(!this.options.title){b.html(" ")}else{b.html(this.options.title)}}}));a(document).on("pwdblclick",".pw-modal-dblclick",pwModalOpenEvent);a(document).on("click",".pw-modal:not(.pw-modal-dblclick):not(.pw-modal-longclick)",pwModalOpenEvent);a(document).on("dblclick",".pw-modal-dblclick",pwModalOpenEvent);a(document).on("longclick",".pw-modal-longclick",pwModalOpenEvent);pwModalDoubleClick()});
\ No newline at end of file