MCPcopy Create free account
hub / github.com/TruthHun/BookStack / updateMenu

Function updateMenu

static/wangEditor/js/wangEditor.js:6169–6179  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6167
6168 // ------ 点击时,禁用其他标签 ------
6169 function updateMenu() {
6170 var rangeElem = editor.getRangeElem();
6171 var targetElem = editor.getSelfOrParentByName(rangeElem, 'code');
6172 if (targetElem) {
6173 // 在 code 之内,禁用其他菜单
6174 editor.disableMenusExcept('insertcode');
6175 } else {
6176 // 不是在 code 之内,启用其他菜单
6177 editor.enableMenusExcept('insertcode');
6178 }
6179 }
6180 $txt.on('keydown click', function (e) {
6181 // 此处必须使用 setTimeout 异步处理,否则不对
6182 setTimeout(updateMenu);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected