Commit 8ea0a6ee authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge remote-tracking branch 'origin/raos_work' into crose_work

parents 90f5063e 876d5a66
...@@ -733,4 +733,11 @@ var QfqNS = QfqNS || {}; ...@@ -733,4 +733,11 @@ var QfqNS = QfqNS || {};
return $('#' + this.formId + ' input[name=s]').val(); return $('#' + this.formId + ' input[name=s]').val();
}; };
/**
* @public
*/
n.QfqForm.prototype.isFormChanged = function () {
return this.form.formChanged;
};
})(QfqNS); })(QfqNS);
\ No newline at end of file
...@@ -53,12 +53,26 @@ var QfqNS = QfqNS || {}; ...@@ -53,12 +53,26 @@ var QfqNS = QfqNS || {};
this.settings.fileDeleteUrl); this.settings.fileDeleteUrl);
this.qfqForm.setBsTabs(this.bsTabs); this.qfqForm.setBsTabs(this.bsTabs);
this.qfqForm.on('qfqform.destroyed', this.destroyFormHandler.bind(this)); this.qfqForm.on('qfqform.destroyed', this.destroyFormHandler.bind(this));
window.addEventListener("beforeunload", this.beforeUnloadHandler.bind(this));
} catch (e) { } catch (e) {
n.Log.error(e.message); n.Log.error(e.message);
this.qfqForm = null; this.qfqForm = null;
} }
}; };
/**
* @private
*/
n.QfqPage.prototype.beforeUnloadHandler = function (event) {
var message = "\0/";
if (this.qfqForm.isFormChanged()) {
event.returnValue = message;
return message;
}
};
/** /**
* @private * @private
*/ */
......
...@@ -793,6 +793,7 @@ ...@@ -793,6 +793,7 @@
</div> </div>
</form> </form>
<a href="www.google.ch">away</a>
</div> </div>
<script src="../js/jquery.min.js"></script> <script src="../js/jquery.min.js"></script>
...@@ -1051,6 +1052,7 @@ ...@@ -1051,6 +1052,7 @@
}); });
QfqNS.Log.level = 0; QfqNS.Log.level = 0;
}); });
</script> </script>
</body> </body>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment