Changeset 515 for Dev


Ignore:
Timestamp:
03/13/14 22:42:39 (11 years ago)
Author:
hendrikvanantwerpen
Message:

Also prevent page close when content is dirty.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/app/Router.js

    r491 r515  
    55    "dojo/_base/event",
    66    "dojo/_base/lang",
    7     "dojo/_base/window",
    87    "dojo/hash",
    98    "dojo/on",
    109    "dojo/topic",
    1110    "require"
    12 ], function(Content, Path, declare, event, lang, window, hash, on, topic, require) {
     11], function(Content, Path, declare, event, lang, hash, on, topic, require) {
    1312
    1413    var Router = declare(null,{
     
    2928            }
    3029            this._handleHashChange(hash());
    31             window.onbeforeunload = function() {
    32                 return Content.isDirty() && "Unsaved changes, leave anyway?";
     30            window.onbeforeunload = function(evt) {
     31                var msg = Content.isDirty() ?
     32                        "Unsaved changes, leave anyway?" :
     33                        null;
     34                evt.returnValue = msg;
     35                return msg;
    3336            };
    3437                        topic.subscribe("/dojo/hashchange",
Note: See TracChangeset for help on using the changeset viewer.