kopia lustrzana https://github.com/miklobit/TiddlyWiki5
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 #570print-window-tiddler
rodzic
3a78465d2d
commit
5226c7a2fa
|
@ -296,12 +296,14 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) {
|
|||
{title: draftTitle}
|
||||
}
|
||||
));
|
||||
}
|
||||
if(isConfirmed) {
|
||||
} else if(!tiddler.isModified()) {
|
||||
event.type = "tw-cancel-tiddler";
|
||||
this.dispatchEvent(event);
|
||||
} else if(isConfirmed) {
|
||||
// Save the draft tiddler as the real tiddler
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,{
|
||||
title: draftTitle,
|
||||
"draft.title": undefined,
|
||||
"draft.title": undefined,
|
||||
"draft.of": undefined
|
||||
},this.wiki.getModificationFields()));
|
||||
// Remove the draft tiddler
|
||||
|
|
Ładowanie…
Reference in New Issue