mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-05 21:33:52 +00:00
Prevent saving un-modified tiddlers
When saving a tiddler we check to see if the tiddler has changed (isModified) if it hasn't then bounce the event to tw-cancel-tiddler instead. Addresses first line item in issue #570
This commit is contained in:
parent
3a78465d2d
commit
5226c7a2fa
@ -296,8 +296,10 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
|
|||||||
{title: draftTitle}
|
{title: draftTitle}
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
} else if(!tiddler.isModified()) {
|
||||||
if(isConfirmed) {
|
event.type = "tw-cancel-tiddler";
|
||||||
|
this.dispatchEvent(event);
|
||||||
|
} else if(isConfirmed) {
|
||||||
// Save the draft tiddler as the real tiddler
|
// Save the draft tiddler as the real tiddler
|
||||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
|
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
|
||||||
title: draftTitle,
|
title: draftTitle,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user