[Mobile] Fix plugins registration and running on start
This commit is contained in:
parent
15b584c235
commit
02a06f444b
|
@ -82,15 +82,13 @@ define([
|
||||||
|
|
||||||
setMode: function(mode) {
|
setMode: function(mode) {
|
||||||
this.appConfig = mode;
|
this.appConfig = mode;
|
||||||
|
this.loadPlugins();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
showPluginModal: function(plugin, variationIndex, frameId, urlAddition) {
|
showPluginModal: function(plugin, variationIndex, frameId, urlAddition) {
|
||||||
var me = this,
|
var me = this,
|
||||||
isAndroid = Framework7.prototype.device.android === true,
|
isAndroid = Framework7.prototype.device.android === true;
|
||||||
isEdit = me.appConfig.isEdit;
|
|
||||||
|
|
||||||
uiApp.closeModal();
|
|
||||||
|
|
||||||
var variation = plugin.get_Variations()[variationIndex];
|
var variation = plugin.get_Variations()[variationIndex];
|
||||||
if (variation.get_Visual()) {
|
if (variation.get_Visual()) {
|
||||||
|
@ -104,13 +102,15 @@ define([
|
||||||
size = variation.get_Size(); //size[0] - width, size[1] - height
|
size = variation.get_Size(); //size[0] - width, size[1] - height
|
||||||
if (_.isArray(arrBtns)) {
|
if (_.isArray(arrBtns)) {
|
||||||
_.each(arrBtns, function(b, index){
|
_.each(arrBtns, function(b, index){
|
||||||
if ((isEdit || b.isViewer !== false))
|
if ((me.appConfig.isEdit || b.isViewer !== false))
|
||||||
newBtns[index] = {
|
newBtns[index] = {
|
||||||
text: b.text,
|
text: b.text,
|
||||||
attributes: {result: index}
|
attributes: {result: index}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
uiApp.closeModal();
|
||||||
|
|
||||||
modal = uiApp.modal({
|
modal = uiApp.modal({
|
||||||
title: '',
|
title: '',
|
||||||
text: '',
|
text: '',
|
||||||
|
@ -179,7 +179,6 @@ define([
|
||||||
|
|
||||||
loadConfig: function(data) {
|
loadConfig: function(data) {
|
||||||
this.configPlugins.config = data.config.plugins;
|
this.configPlugins.config = data.config.plugins;
|
||||||
this.loadPlugins();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
loadPlugins: function() {
|
loadPlugins: function() {
|
||||||
|
|
Loading…
Reference in a new issue