From 67303d6a9279cca5d696e6cd6764b54f96a9f89d Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 15 Mar 2022 16:06:34 +0530 Subject: [PATCH] hide embed tab of share modal for docs that don't support embedding --- www/common/inner/share.js | 11 ++++++++++- www/common/sframe-common-outer.js | 10 +--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/www/common/inner/share.js b/www/common/inner/share.js index eeea74e7f..7e2f0a6b0 100644 --- a/www/common/inner/share.js +++ b/www/common/inner/share.js @@ -16,6 +16,15 @@ define([ Messages, nThen, Pages) { var Share = {}; + var embeddableApps = [ + 'code', + 'form', + 'kanban', + 'pad', + 'slide', + 'whiteboard', + ].map(app => `/${app}/`); + var createShareWithFriends = function (config, onShare, linkGetter) { var common = config.common; var sframeChan = common.getSframeChannel(); @@ -772,7 +781,7 @@ define([ icon: "fa fa-link", active: !contactsActive, }]; - if (!opts.static && !ApiConfig.disableEmbedding) { + if (!opts.static && !ApiConfig.disableEmbedding && embeddableApps.includes(pathname)) { tabs.push({ getTab: getEmbedTab, title: Messages.share_embedCategory, diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 87cfa6f7e..ed6962328 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -9,22 +9,14 @@ define([ var common = {}; var embeddableApps = [ - //'calendar', 'code', - //'doc', // XXX - // 'drive', // XXX - //'file', // doesn't suggest iframes 'form', 'kanban', 'pad', - // 'poll', // XXX - //'presentation', // XXX - // 'sheet', // XXX 'slide', - //'teams', // XXX 'whiteboard', ].map(function (x) { - return `/${x}/`; // XXX intentionally break IE or anything that doesn't support template literals + return `/${x}/`; }); common.initIframe = function (waitFor, isRt, pathname) {