We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10487 MODX Staff
    • 1,535 Posts
    Is just stumbled over that feature request: Confirmation when quiting an edited manager page without saving. Seems the checkDirt() function isn’t working anymore...

    Edit: Can confirm that on Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.7) Gecko/20060921 Ubuntu/dapper-security Firefox/1.5.0.7
    The problem is that the checkDirt() function uses IE-specific code. It can be made to work in FF by using the following instead of checkDirt():
     window.onbeforeunload = function (evt) {
            if (documentDirty==true) {
      var message = "<?php echo $_lang['warning_not_saved']; ?>";
      if (typeof evt == 'undefined') {
        evt = window.event;
      }
      if (evt) {
        evt.returnValue = message;
      }
      return message;
      }
    }


    Unfortunately, that’s about as good as it gets, it appears that Safari (2.0.4 anyway) doesn’t support the ’onbeforeunload’ event, I suspect that neither does Opera.
      Garry Nutting
      Senior Developer
      MODX, LLC

      Email: [email protected]
      Twitter: @garryn
      Web: modx.com
      • 25663 MODX Staff
      • 12,272 Posts
      Locking this one down as it’s way too long to follow now. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me

      This discussion is closed to further replies. Keep calm and carry on.