We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31178
    • 128 Posts
    This has been bugging me for a while. It only seems to happen with IE7. I mentioned it back in September: http://modxcms.com/forums/index.php?topic=5403.345

    When editing a document and clicking save I get the ’Are you sure you want to navigate away....’ message. Even though I am not navigating away, I’m clicking Save.

    Looking around the net there seems to be issues with the onbeforeunload event in IE7:

    http://www.nathanblomquist.net/blog/2007/10/12/onbeforeunload-ie7-woes/

    So I’ve modified 3 files and it might have fixed it.  undecided I’m not sure if it causes any issues and my coding at this level may be a bit iffy. I think I am on the right lines but maybe someone could verify what I have done and maybe adapt it if needed. All this is using the latest versions: MODx 9.6.3 and TinyMCE 3.2.1.1

    1) manager/actions/mutate_content.dynamic.php
    line 510 add: documentEXIT=true;
    
    before
    
    <table cellpadding="0" cellspacing="0" class="actionButtons"><tr>
    		<td id="Button1"><a href="#" onclick="documentDirty=false; document.mutate.save.click();">
    
    after
    
    <table cellpadding="0" cellspacing="0" class="actionButtons"><tr>
    		<td id="Button1"><a href="#" onclick="documentDirty=false; documentEXIT=true; document.mutate.save.click();">
    


    2) manager/includes/header.inc.php
    line 55 add: var documentEXIT=false;
    
    before
    
            var documentDirty=false;
    
            function checkDirt(evt) {
                if(documentDirty==true) {
    
    after
    
            var documentDirty=false;
    var documentEXIT=false;
            function checkDirt(evt) {
                if(documentDirty==true) {
    


    3) assets/plugins/tinymce3211/tinymce.functions.php
    Line 254 add: if (!documentEXIT)
     
    before
    
    function myCustomOnChangeHandler() {
    	documentDirty = true;
    }
    
    after
    
    function myCustomOnChangeHandler() {
    	if (typeof documentEXIT=="undefined") documentDirty = true;
    	else if (!documentEXIT) documentDirty = true;
    }



      • 3749
      • 24,544 Posts
      That’s annoyed me too. Could you please post the bug and your code at Jira (via the "BUGS REQUESTS" link at the upper right)? Issues tend to get overlooked if they’re not reported on Jira.

      Thanks,

      Bob
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 31178
        • 128 Posts
        Sure can. Created as issue MODX-640

        http://svn.modxcms.com/jira/browse/MODX-640
          • 3749
          • 24,544 Posts
          Quote from: uxello at Feb 09, 2009, 01:15 PM

          Sure can. Created as issue MODX-640

          http://svn.modxcms.com/jira/browse/MODX-640

          Thanks! grin
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 31178
            • 128 Posts
            I have since found out I need to alter the fix in the tinymce.funtions.php file to check the variable exists. Otherwise if TinyMCE is used elsewhere besides manager it fails due to documentEXIT not existing.

            function myCustomOnChangeHandler() { 
            if (typeof documentEXIT=="undefined") documentDirty = true; 
            else if (!documentEXIT) documentDirty = true; 
            }