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, buttons: isCustomWindow ? undefined : newBtns,
toolcallback: _.bind(this.onToolClose, this), toolcallback: _.bind(this.onToolClose, this),
help: !!help, help: !!help,
loader: plugin.get_Loader(),
modal: isModal!==undefined ? isModal : true modal: isModal!==undefined ? isModal : true
}); });
me.pluginDlg.on({ me.pluginDlg.on({

View file

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

View file

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