mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
Merge pull request 'fix bug 74837' (#301) from fix/bug-74837 into fix/fix-bugs
This commit is contained in:
@ -3,7 +3,7 @@ window.AboutDialog = function(params) {
|
||||
|
||||
!params && (params = {});
|
||||
|
||||
let $el, $dialogTitle, $dialogBody;
|
||||
let $el, $dialogTitle, $dialogBody, pendingBody;
|
||||
const events = {close: params.onclose};
|
||||
|
||||
const _template = `
|
||||
@ -21,21 +21,28 @@ window.AboutDialog = function(params) {
|
||||
};
|
||||
|
||||
function close(opts) {
|
||||
$el.remove();
|
||||
$el.get(0).close();
|
||||
if (events.close) {
|
||||
events.close(opts);
|
||||
}
|
||||
}
|
||||
|
||||
function setBody(data) {
|
||||
$dialogBody.html(data);
|
||||
}
|
||||
|
||||
return {
|
||||
setBody: function(data) {
|
||||
$dialogBody.html(data);
|
||||
if ($dialogBody) {
|
||||
$dialogBody.html(data);
|
||||
} else {
|
||||
pendingBody = data;
|
||||
}
|
||||
},
|
||||
show: function () {
|
||||
if ($el && $el.length) {
|
||||
const dlg = $el.get(0);
|
||||
if (!dlg.open) dlg.showModal();
|
||||
return;
|
||||
}
|
||||
|
||||
$el = $('#placeholder').append(_template).find('.dlg-about');
|
||||
$el.width(576);
|
||||
|
||||
@ -44,6 +51,10 @@ window.AboutDialog = function(params) {
|
||||
$dialogTitle.find('.tool.close').bind('click', onCloseClick);
|
||||
|
||||
$dialogBody = $el.find('.body');
|
||||
if (pendingBody) {
|
||||
$dialogBody.html(pendingBody);
|
||||
pendingBody = null;
|
||||
}
|
||||
|
||||
$el.get(0).showModal();
|
||||
$el.addClass('scaled');
|
||||
|
||||
@ -155,6 +155,7 @@
|
||||
this.view.$menuitem && this.view.$menuitem.removeClass('extra');
|
||||
this.view.$body = $(this.view.paneltemplate(args));
|
||||
this.view.$dialog = new AboutDialog();
|
||||
this.view.$dialog.setBody(this.view.$body)
|
||||
} else {
|
||||
if ( !!args.opts && !!args.opts.edition ) {
|
||||
$('#idx-ver-edition').html(args.opts.edition);
|
||||
@ -277,7 +278,6 @@
|
||||
const onPanelShow = function(panel) {
|
||||
if (panel === this.action) {
|
||||
this.view.$dialog.show();
|
||||
this.view.$dialog.setBody(this.view.$body);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user