1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 13:29:56 +00:00

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)

This commit is contained in:
saqimtiaz 2017-06-29 09:55:43 +02:00 committed by Jeremy Ruston
parent 2d0ac7245f
commit 48e0186ba9

View File

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