From 13f6bd84e97f4aa5a1c87a4de5b5ed1b4bf217e8 Mon Sep 17 00:00:00 2001 From: linonetwo Date: Sat, 23 Sep 2023 00:05:36 +0800 Subject: [PATCH] refactor: remove unusned hook --- boot/boot.js | 14 -------------- core/modules/widgets/navigator.js | 1 - editions/dev/tiddlers/new/Hook__th-navigated.tid | 11 ----------- 3 files changed, 26 deletions(-) delete mode 100644 editions/dev/tiddlers/new/Hook__th-navigated.tid diff --git a/boot/boot.js b/boot/boot.js index 2636cb8f4..06d4628c0 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -2674,20 +2674,6 @@ $tw.hooks.addHook = function(hookName,definition) { } }; -/* -Delete hooks from the hashmap -*/ -$tw.hooks.removeHook = function(hookName,definition) { - if($tw.utils.hop($tw.hooks.names,hookName)) { - var index = $tw.hooks.names[hookName].findIndex(function(hook) { - return hook === definition; - }); - if(index !== -1) { - $tw.hooks.names[hookName].splice(index, 1); - } - } -}; - /* Invoke the hook by key */ diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index 423f65459..ed5d1929e 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -155,7 +155,6 @@ NavigatorWidget.prototype.handleNavigateEvent = function(event) { this.addToHistory(event.navigateTo,event.navigateFromClientRect,event.toAnchor); } } - $tw.hooks.invokeHook("th-navigated",event); return false; }; diff --git a/editions/dev/tiddlers/new/Hook__th-navigated.tid b/editions/dev/tiddlers/new/Hook__th-navigated.tid deleted file mode 100644 index 0315529ba..000000000 --- a/editions/dev/tiddlers/new/Hook__th-navigated.tid +++ /dev/null @@ -1,11 +0,0 @@ -tags: HookMechanism -title: Hook: th-navigated -type: text/vnd.tiddlywiki - -This hook allows plugins to do things after navigation takes effect. - -Hook function parameters are same as [[Hook: th-navigating]]: - -Return value: - -* possibly modified event object