1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-16 03:34:33 +02:00

Correct issue in JqueryUI/modal.js where it used $() rather than jQuery() in one spot, and also fix issue where modal would stay open in some cases when we didn't want it to

This commit is contained in:
Ryan Cramer
2018-06-12 07:12:04 -04:00
parent 9ac3bfb5ad
commit 738c2db3c5
2 changed files with 7 additions and 3 deletions

View File

@@ -188,7 +188,7 @@ function pwModalWindow(href, options, size) {
$iframe.data('settings', settings); $iframe.data('settings', settings);
$iframe.load(function() { $iframe.load(function() {
if(typeof settings.title == "undefined" || !settings.title) { if(typeof settings.title == "undefined" || !settings.title) {
var title = $('<textarea />').text($iframe.contents().find('title').text()).html(); var title = jQuery('<textarea />').text($iframe.contents().find('title').text()).html();
$iframe.dialog('option', 'title', title); $iframe.dialog('option', 'title', title);
} }
$iframe.contents().find('form').css('-webkit-backface-visibility', 'hidden'); // to prevent jumping $iframe.contents().find('form').css('-webkit-backface-visibility', 'hidden'); // to prevent jumping
@@ -332,7 +332,8 @@ function pwModalOpenEvent(e) {
if(closeOnLoad) { if(closeOnLoad) {
// this occurs when item saved and resulting page is loaded // 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 there are no error messages present, close the window
if(typeof Notifications != "undefined") { if(typeof Notifications != "undefined") {
var messages = []; var messages = [];
@@ -347,6 +348,9 @@ function pwModalOpenEvent(e) {
} }
$iframe.dialog('close'); $iframe.dialog('close');
return; return;
} else {
// console.log('error items prevent modal autoclose:');
// console.log($errorItems);
} }
} }

File diff suppressed because one or more lines are too long