Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #887 from bossloper/patch-19
Browse files Browse the repository at this point in the history
Update qm.inc.php
  • Loading branch information
Dmi3yy authored Oct 31, 2016
2 parents 69a9cda + 1bcb503 commit 0592879
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion assets/plugins/qm/qm.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,33 @@ function Run() {
$'.$jvar.'("body").css({"overflow":"hidden"});
$'.$jvar.'("html").css({"overflow":"hidden"});
$'.$jvar.'("#qmEditor").css({"display":"none"});
});
});
$'.$jvar.'(document).bind("cbox_cleanup", function(){
//window is closing and cannot be stopped so clear dirty settings for all fields and tinyMCE
var foundit;
//loop through the iframes, checking their scr
iframearray = document.getElementsByTagName(\'iframe\');
for(var i=0; i < iframearray.length; i++) {
//if the matching colorbox src, we have found the correct iframe
haystack=iframearray[i].src;
needle="'.$this->modx->config["site_url"]."manager/index.php?a=27".'";
if(haystack.substr(0, needle.length) == needle){
foundit=iframearray[i]; //assign it to the foundit variable created earlier
break; //no need to keep looking
}
}
if (foundit) {
foundit.contentWindow.window.documentDirty=false; //clear document dirty for fields
//loop through tinyMCE editors and clear any dirty flags
if (typeof(foundit.contentWindow.window.tinyMCE)!==\'undefined\') {
var i, t = foundit.contentWindow.window.tinyMCE.editors;for (i in t){
if (t.hasOwnProperty(i)){ t[i].isNotDirty=true }}
}
}
});
$'.$jvar.'(document).bind("cbox_closed", function(){
$'.$jvar.'("body").css({"overflow":"auto"});
Expand Down

0 comments on commit 0592879

Please sign in to comment.