[desktop] for bug 59316

This commit is contained in:
Maxim Kadushkin 2022-10-11 22:12:02 +03:00
parent eae06bd4c9
commit 659e7cec50
8 changed files with 26 additions and 6 deletions

View file

@ -67,7 +67,7 @@ define([
if (item) {
var panel = this.panels[item.options.action];
if (item.options.action === 'help') {
if ( panel.usedHelpCenter === true && navigator.onLine ) {
if ( panel.noHelpContents === true && navigator.onLine ) {
this.fireEvent('item:click', [this, 'external-help', true]);
window.open(panel.urlHelpCenter, '_blank');
return;

View file

@ -2113,7 +2113,7 @@ define([
} else {
if ( Common.Controllers.Desktop.isActive() ) {
if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) {
me.usedHelpCenter = true;
me.noHelpContents = true;
me.iFrame.src = '../../common/main/resources/help/download.html';
} else {
store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang;

View file

@ -271,6 +271,7 @@ define([
this.showHistory();
}
break;
case 'external-help': close_menu = true; break;
default: close_menu = false;
}

View file

@ -69,6 +69,13 @@ define([
var item = _.findWhere(this.items, {el: event.currentTarget});
if (item) {
var panel = this.panels[item.options.action];
if (item.options.action === 'help') {
if ( panel.noHelpContents === true && navigator.onLine ) {
this.fireEvent('item:click', [this, 'external-help', true]);
window.open(panel.urlHelpCenter, '_blank');
return;
}
}
this.fireEvent('item:click', [this, item.options.action, !!panel]);
if (panel) {

View file

@ -1505,6 +1505,7 @@ define([
this.menu = options.menu;
this.urlPref = 'resources/help/{{DEFAULT_LANG}}/';
this.openUrl = null;
this.urlHelpCenter = '{{HELP_CENTER_WEB_EDITORS}}';
this.en_data = [
{"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Presentation Editor user interface", "headername": "Program Interface"},
@ -1610,9 +1611,10 @@ define([
store.fetch(config);
} else {
if ( Common.Controllers.Desktop.isActive() ) {
if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() )
if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) {
me.noHelpContents = true;
me.iFrame.src = '../../common/main/resources/help/download.html';
else {
} else {
store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang;
me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + store.contentLang + '/';
store.url = me.urlPref + 'Contents.json';

View file

@ -314,6 +314,7 @@ define([
this.showHistory();
}
break;
case 'external-help': close_menu = true; break;
default: close_menu = false;
}

View file

@ -56,6 +56,13 @@ define([
var item = _.findWhere(this.items, {el: event.currentTarget});
if (item) {
var panel = this.panels[item.options.action];
if (item.options.action === 'help') {
if ( panel.noHelpContents === true && navigator.onLine ) {
this.fireEvent('item:click', [this, 'external-help', true]);
window.open(panel.urlHelpCenter, '_blank');
return;
}
}
this.fireEvent('item:click', [this, item.options.action, !!panel]);
if (panel) {

View file

@ -1877,6 +1877,7 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
this.menu = options.menu;
this.urlPref = 'resources/help/{{DEFAULT_LANG}}/';
this.openUrl = null;
this.urlHelpCenter = '{{HELP_CENTER_WEB_EDITORS}}';
this.en_data = [
{"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Spreadsheet Editor user interface", "headername": "Program Interface"},
@ -1984,9 +1985,10 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
store.fetch(config);
} else {
if ( Common.Controllers.Desktop.isActive() ) {
if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() )
if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) {
me.noHelpContents = true;
me.iFrame.src = '../../common/main/resources/help/download.html';
else {
} else {
store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang;
me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + store.contentLang + '/';
store.url = me.urlPref + 'Contents.json';