hide the 'embed' tab of the share menu if 'disableEmbedding' is true

pull/1/head
ansuz 3 years ago
parent 96f4162a58
commit 52529f1a65

@ -1,5 +1,6 @@
define([ define([
'jquery', 'jquery',
'/api/config',
'/common/common-util.js', '/common/common-util.js',
'/common/common-hash.js', '/common/common-hash.js',
'/common/common-interface.js', '/common/common-interface.js',
@ -11,7 +12,7 @@ define([
'/customize/messages.js', '/customize/messages.js',
'/bower_components/nthen/index.js', '/bower_components/nthen/index.js',
'/customize/pages.js', '/customize/pages.js',
], function ($, Util, Hash, UI, UIElements, Feedback, Modal, h, Clipboard, ], function ($, ApiConfig, Util, Hash, UI, UIElements, Feedback, Modal, h, Clipboard,
Messages, nThen, Pages) { Messages, nThen, Pages) {
var Share = {}; var Share = {};
@ -771,9 +772,9 @@ define([
icon: "fa fa-link", icon: "fa fa-link",
active: !contactsActive, active: !contactsActive,
}]; }];
if (!opts.static) { if (!opts.static && !ApiConfig.disableEmbedding) {
tabs.push({ tabs.push({
getTab: getEmbedTab, getTab: getEmbedTab, // XXX
title: Messages.share_embedCategory, title: Messages.share_embedCategory,
icon: "fa fa-code", icon: "fa fa-code",
onShow: onShowEmbed, onShow: onShowEmbed,
@ -965,11 +966,16 @@ define([
title: Messages.share_linkCategory, title: Messages.share_linkCategory,
icon: "fa fa-link", icon: "fa fa-link",
active: !hasFriends, active: !hasFriends,
}, {
getTab: getFileEmbedTab,
title: Messages.share_embedCategory,
icon: "fa fa-code",
}]; }];
if (!ApiConfig.disableEmbedding) {
tabs.push({
getTab: getFileEmbedTab,
title: Messages.share_embedCategory,
icon: "fa fa-code",
});
}
Modal.getModal(common, opts, tabs, cb); Modal.getModal(common, opts, tabs, cb);
}; };

Loading…
Cancel
Save