[DE] Обработка параметров плагина - isViewer (доступен в режиме просмотра), EditorsSupport (для каких редакторов доступен плагин).
This commit is contained in:
parent
7b86f88935
commit
8f0cda5ced
|
@ -1695,13 +1695,21 @@ define([
|
|||
},
|
||||
|
||||
updatePluginsList: function(plugins) {
|
||||
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins');
|
||||
var pluginStore = this.getApplication().getCollection('Common.Collections.Plugins'),
|
||||
isEdit = this.appOptions.isEdit;
|
||||
if (pluginStore && plugins) {
|
||||
var arr = [];
|
||||
plugins.pluginsData.forEach(function(item){
|
||||
var variations = item.variations,
|
||||
variationsArr = [];
|
||||
variations.forEach(function(itemVar){
|
||||
var isSupported = false;
|
||||
for (var i=0; i<itemVar.EditorsSupport.length; i++){
|
||||
if (itemVar.EditorsSupport[i]=='word') {
|
||||
isSupported = true; break;
|
||||
}
|
||||
}
|
||||
if (isSupported && (isEdit || itemVar.isViewer))
|
||||
variationsArr.push(new Common.Models.PluginVariation({
|
||||
description: itemVar.description,
|
||||
index: itemVar.index,
|
||||
|
@ -1718,7 +1726,7 @@ define([
|
|||
buttons: itemVar.buttons
|
||||
}));
|
||||
});
|
||||
|
||||
if (variationsArr.length>0)
|
||||
arr.push(new Common.Models.Plugin({
|
||||
name : item.name,
|
||||
guid: item.guid,
|
||||
|
|
Loading…
Reference in a new issue