hide embed tab of share modal for docs that don't support embedding

pull/1/head
ansuz 3 years ago
parent 1e2ef32c39
commit 67303d6a92

@ -16,6 +16,15 @@ define([
Messages, nThen, Pages) { Messages, nThen, Pages) {
var Share = {}; var Share = {};
var embeddableApps = [
'code',
'form',
'kanban',
'pad',
'slide',
'whiteboard',
].map(app => `/${app}/`);
var createShareWithFriends = function (config, onShare, linkGetter) { var createShareWithFriends = function (config, onShare, linkGetter) {
var common = config.common; var common = config.common;
var sframeChan = common.getSframeChannel(); var sframeChan = common.getSframeChannel();
@ -772,7 +781,7 @@ define([
icon: "fa fa-link", icon: "fa fa-link",
active: !contactsActive, active: !contactsActive,
}]; }];
if (!opts.static && !ApiConfig.disableEmbedding) { if (!opts.static && !ApiConfig.disableEmbedding && embeddableApps.includes(pathname)) {
tabs.push({ tabs.push({
getTab: getEmbedTab, getTab: getEmbedTab,
title: Messages.share_embedCategory, title: Messages.share_embedCategory,

@ -9,22 +9,14 @@ define([
var common = {}; var common = {};
var embeddableApps = [ var embeddableApps = [
//'calendar',
'code', 'code',
//'doc', // XXX
// 'drive', // XXX
//'file', // doesn't suggest iframes
'form', 'form',
'kanban', 'kanban',
'pad', 'pad',
// 'poll', // XXX
//'presentation', // XXX
// 'sheet', // XXX
'slide', 'slide',
//'teams', // XXX
'whiteboard', 'whiteboard',
].map(function (x) { ].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) { common.initIframe = function (waitFor, isRt, pathname) {

Loading…
Cancel
Save