From 9d18971e60be3f87de3f52be39e3dac6a3fa5ddb Mon Sep 17 00:00:00 2001 From: dingyongliang Date: Mon, 10 Mar 2025 16:14:51 +0800 Subject: [PATCH] * [task#139076] only show moreItems on zentaopms. --- lib/zin/wg/docapp/js/v1.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/zin/wg/docapp/js/v1.js b/lib/zin/wg/docapp/js/v1.js index c2ba4f1eab..4a49c44a71 100644 --- a/lib/zin/wg/docapp/js/v1.js +++ b/lib/zin/wg/docapp/js/v1.js @@ -744,6 +744,10 @@ function importFileToEditor(type, options) }); } +function isOpenVersion(version) { + return /^\d/.test(version || $('#zuiCSS').attr('href').split('?v=').pop()); +} + /** * 定义文档各个试图和 UI 元素的上的操作方法。 * Define the operation methods on the views and UI elements of the doc. @@ -847,7 +851,7 @@ const actionsMap = } } const docApp = this; - const isOpen = /^\d/.test(config.version || $('#zuiCSS').attr('href').split('?v=').pop()); + const isOpen = isOpenVersion(config.version); if(!isOpen && docApp && docApp.mode === 'view' && doc.status != 'draft' && !doc.api) { moreItems.push({icon: 'link', text: getLang('relateObject'), className: 'relateObject-btn', command: 'toggleViewSideTab/relateObject'}) @@ -1043,7 +1047,7 @@ const actionsMap = } const moreItems = []; - if((doc.contentType === 'doc' || doc.contentType === 'markdown') && !isApiDoc(doc)) + if(isOpenVersion() && (doc.contentType === 'doc' || doc.contentType === 'markdown') && !isApiDoc(doc)) { if(config.debug > 5) moreItems.push({text: lang.importConfluence, command: 'importFile/confluence'}); moreItems.push(