Merge plugins from config, server and from event asc_onPluginsInit.

This commit is contained in:
Julia Radzhabova 2017-10-13 12:47:39 +03:00
parent 9757cb175b
commit d668bd150d
3 changed files with 15 additions and 12 deletions

View file

@ -1927,9 +1927,10 @@ define([
if (plugins) {
var arr = [], arrUI = [];
plugins.pluginsData.forEach(function(item){
if (uiCustomize!==undefined && _.find(arr, function(arritem) {
return (arritem.get('baseUrl') == item.baseUrl || arritem.get('guid') == item.guid);
})) return;
if (_.find(arr, function(arritem) {
return (arritem.get('baseUrl') == item.baseUrl || arritem.get('guid') == item.guid);
}) || pluginStore.findWhere({baseUrl: item.baseUrl}) || pluginStore.findWhere({guid: item.guid}))
return;
var variationsArr = [],
pluginVisible = false;
@ -1976,7 +1977,7 @@ define([
this.UICustomizePlugins = arrUI;
if ( !uiCustomize ) {
if (pluginStore) pluginStore.reset(arr);
if (pluginStore) pluginStore.add(arr);
this.appOptions.canPlugins = !pluginStore.isEmpty();
}
} else if (!uiCustomize){

View file

@ -1696,9 +1696,10 @@ define([
if (plugins) {
var arr = [], arrUI = [];
plugins.pluginsData.forEach(function(item){
if (uiCustomize!==undefined && _.find(arr, function(arritem) {
return (arritem.get('baseUrl') == item.baseUrl || arritem.get('guid') == item.guid);
})) return;
if (_.find(arr, function(arritem) {
return (arritem.get('baseUrl') == item.baseUrl || arritem.get('guid') == item.guid);
}) || pluginStore.findWhere({baseUrl: item.baseUrl}) || pluginStore.findWhere({guid: item.guid}))
return;
var variationsArr = [],
pluginVisible = false;
@ -1744,7 +1745,7 @@ define([
this.UICustomizePlugins = arrUI;
if ( !uiCustomize ) {
if (pluginStore) pluginStore.reset(arr);
if (pluginStore) pluginStore.add(arr);
this.appOptions.canPlugins = !pluginStore.isEmpty();
}
} else if (!uiCustomize){

View file

@ -1891,9 +1891,10 @@ define([
if (plugins) {
var arr = [], arrUI = [];
plugins.pluginsData.forEach(function(item){
if (uiCustomize!==undefined && _.find(arr, function(arritem) {
return (arritem.get('baseUrl') == item.baseUrl || arritem.get('guid') == item.guid);
})) return;
if (_.find(arr, function(arritem) {
return (arritem.get('baseUrl') == item.baseUrl || arritem.get('guid') == item.guid);
}) || pluginStore.findWhere({baseUrl: item.baseUrl}) || pluginStore.findWhere({guid: item.guid}))
return;
var variationsArr = [],
pluginVisible = false;
@ -1939,7 +1940,7 @@ define([
this.UICustomizePlugins = arrUI;
if (!uiCustomize) {
if (pluginStore) pluginStore.reset(arr);
if (pluginStore) pluginStore.add(arr);
this.appOptions.canPlugins = !pluginStore.isEmpty();
}
} else if (!uiCustomize){