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