mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Editor: Warn if title change is unsaved
closes #3643 - TitleScratch is compared with Title; if there’s a difference, we have unsaved changes and open up the modal.
This commit is contained in:
parent
4b83dfd6ab
commit
39f10228f6
1 changed files with 6 additions and 0 deletions
|
@ -88,6 +88,8 @@ var EditorControllerMixin = Ember.Mixin.create(MarkerManager, {
|
||||||
|
|
||||||
var model = this.get('model'),
|
var model = this.get('model'),
|
||||||
markdown = this.get('markdown'),
|
markdown = this.get('markdown'),
|
||||||
|
title = this.get('title'),
|
||||||
|
titleScratch = this.get('titleScratch'),
|
||||||
scratch = this.getMarkdown().withoutMarkers,
|
scratch = this.getMarkdown().withoutMarkers,
|
||||||
changedAttributes;
|
changedAttributes;
|
||||||
|
|
||||||
|
@ -95,6 +97,10 @@ var EditorControllerMixin = Ember.Mixin.create(MarkerManager, {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (titleScratch !== title) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// since `scratch` is not model property, we need to check
|
// since `scratch` is not model property, we need to check
|
||||||
// it explicitly against the model's markdown attribute
|
// it explicitly against the model's markdown attribute
|
||||||
if (markdown !== scratch) {
|
if (markdown !== scratch) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue