Plugins: add isDisplayedInViewer parameter for display/hide plugin in the viewer interface

This commit is contained in:
Julia Radzhabova 2018-12-13 11:15:28 +03:00
parent 262387a139
commit 4db246e4a6
4 changed files with 4 additions and 3 deletions

View file

@ -56,6 +56,7 @@ define([
index: 0,
icons: undefined,
isViewer: false,
isDisplayedInViewer: true,
EditorsSupport: ["word", "cell", "slide"],
isVisual: false,
isCustomWindow: false,

View file

@ -2099,7 +2099,7 @@ define([
var variationsArr = [],
pluginVisible = false;
item.variations.forEach(function(itemVar){
var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'word');
var visible = (isEdit || itemVar.isViewer && (itemVar.isDisplayedInViewer!==false)) && _.contains(itemVar.EditorsSupport, 'word');
if ( visible ) pluginVisible = true;
if (item.isUICustomizer ) {

View file

@ -1845,7 +1845,7 @@ define([
var variationsArr = [],
pluginVisible = false;
item.variations.forEach(function(itemVar){
var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'slide');
var visible = (isEdit || itemVar.isViewer && (itemVar.isDisplayedInViewer!==false)) && _.contains(itemVar.EditorsSupport, 'slide');
if ( visible ) pluginVisible = true;
if ( item.isUICustomizer ) {

View file

@ -2042,7 +2042,7 @@ define([
var variationsArr = [],
pluginVisible = false;
item.variations.forEach(function(itemVar){
var visible = (isEdit || itemVar.isViewer) && _.contains(itemVar.EditorsSupport, 'cell');
var visible = (isEdit || itemVar.isViewer && (itemVar.isDisplayedInViewer!==false)) && _.contains(itemVar.EditorsSupport, 'cell');
if ( visible ) pluginVisible = true;
if ( item.isUICustomizer ) {