Skip to content

Commit

Permalink
feat: sidebar support neotw-play-sound event
Browse files Browse the repository at this point in the history
  • Loading branch information
oeyoews committed Sep 30, 2024
1 parent ad6450d commit 0c424e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/oeyoews/neotw-menubar/tiddlers/toggleSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ module.exports = () => {
const opt = {
suppressTimestamp: true,
};
// 触发切换侧边栏声音
$tw.rootWidget.dispatchEvent({
type: 'neotw-play-sound',
});
if ($tw.wiki.getTiddlerText(`$:/state/notebook-sidebar`) == 'yes') {
$tw.wiki.setText(`$:/state/notebook-sidebar`, 'text', null, 'no', opt);
} else {
Expand Down

0 comments on commit 0c424e7

Please sign in to comment.