Handle loader parameter for plugins

This commit is contained in:
Julia Radzhabova 2022-07-28 19:16:46 +03:00
parent c161b84cfd
commit 7b7a579320
3 changed files with 12 additions and 7 deletions

View file

@ -381,6 +381,7 @@ define([
buttons: isCustomWindow ? undefined : newBtns,
toolcallback: _.bind(this.onToolClose, this),
help: !!help,
loader: plugin.get_Loader(),
modal: isModal!==undefined ? isModal : true
});
me.pluginDlg.on({

View file

@ -77,6 +77,7 @@ define([
_options.tpl = _.template(this.template)(_options);
this.url = options.url || '';
this.loader = (options.loader!==undefined) ? options.loader : true;
this.frameId = options.frameId || 'plugin_iframe';
Common.UI.Window.prototype.initialize.call(this, _options);
},
@ -102,13 +103,15 @@ define([
iframe.onload = _.bind(this._onLoad,this);
var me = this;
setTimeout(function(){
if (me.isLoaded) return;
me.loadMask = new Common.UI.LoadMask({owner: $('#id-plugin-placeholder')});
me.loadMask.setTitle(me.textLoading);
me.loadMask.show();
if (me.isLoaded) me.loadMask.hide();
}, 500);
if (this.loader) {
setTimeout(function(){
if (me.isLoaded) return;
me.loadMask = new Common.UI.LoadMask({owner: $('#id-plugin-placeholder')});
me.loadMask.setTitle(me.textLoading);
me.loadMask.show();
if (me.isLoaded) me.loadMask.hide();
}, 500);
}
iframe.src = this.url;
$('#id-plugin-placeholder').append(iframe);

View file

@ -175,6 +175,7 @@ define([
buttons: isCustomWindow ? undefined : newBtns,
toolcallback: _.bind(this.onToolClose, this),
help: !!help,
loader: plugin.get_Loader(),
modal: isModal!==undefined ? isModal : true
});
me.pluginDlg.on({