Added th-editing-tiddler hook in handleEditTiddlerEvent. A plugin can use the hook to return false and prevent editing or provide alternative editing options. (#2901)

print-window-tiddler
saqimtiaz 2017-06-29 09:55:43 +02:00 zatwierdzone przez Jeremy Ruston
rodzic 2d0ac7245f
commit 48e0186ba9
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -211,6 +211,10 @@ NavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) {
// Place a tiddler in edit mode
NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) {
var editTiddler = $tw.hooks.invokeHook("th-editing-tiddler",event);
if(!editTiddler) {
return false;
}
var self = this;
function isUnmodifiedShadow(title) {
return self.wiki.isShadowTiddler(title) && !self.wiki.tiddlerExists(title);