|
|
@ -137,10 +137,8 @@ module.exports = Backbone.Model.extend({ |
|
|
const stm = this.get('StorageManager'); |
|
|
const stm = this.get('StorageManager'); |
|
|
const changes = this.get('changesCount'); |
|
|
const changes = this.get('changesCount'); |
|
|
|
|
|
|
|
|
if (this.config.noticeOnUnload && changes) { |
|
|
if (this.config.noticeOnUnload) { |
|
|
window.onbeforeunload = e => 1; |
|
|
window.onbeforeunload = changes ? e => 1 : null; |
|
|
} else { |
|
|
|
|
|
window.onbeforeunload = null; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (stm.isAutosave() && changes >= stm.getStepsBeforeSave()) { |
|
|
if (stm.isAutosave() && changes >= stm.getStepsBeforeSave()) { |
|
|
|