diff --git a/common/loginpage/src/panels.js b/common/loginpage/src/panels.js index 22a595900..8097d3957 100644 --- a/common/loginpage/src/panels.js +++ b/common/loginpage/src/panels.js @@ -49,7 +49,7 @@ $(document).ready(function() { !window.app && (window.app = {controller:{}}); !window.app.controller && (window.app.controller = {}); - if ( !window.utils.isWinXp && !!window.ControllerTemplates ) + if ( !!window.ControllerTemplates ) window.app.controller.templates = (new ControllerTemplates).init(); window.app.controller.recent = (new ControllerRecent).init(); window.app.controller.folders = (new ControllerFolders).init(); diff --git a/common/loginpage/src/paneltemplates.js b/common/loginpage/src/paneltemplates.js index e9da96d02..82fc5af8d 100644 --- a/common/loginpage/src/paneltemplates.js +++ b/common/loginpage/src/paneltemplates.js @@ -82,7 +82,7 @@

${_lang.actTemplates}

-
+ @@ -224,44 +224,49 @@ this.view.$panel.addClass('local'); $('.nav-item[data-value=local]', this.view.$panel).addClass('selected'); - const _check_url_avail = () => { - if ( !iframe ) { - fetch(_url_templates.replace('{0}', 'en'), {mode: 'no-cors'}). - then(r => { - if ( r.status == 200 || r.type == 'opaque' ) { - iframe = _create_and_inject_iframe(); - } - }). - catch(e => console.error('error on check templates url', e)); + if ( window.utils.isWinXp ) { + $('#idx-nav-templates', this.view.$panel).hide(); + this.view.$panel.addClass('win_xp'); + } else { + const _check_url_avail = () => { + if ( !iframe ) { + fetch(_url_templates.replace('{0}', 'en'), {mode: 'no-cors'}). + then(r => { + if ( r.status == 200 || r.type == 'opaque' ) { + iframe = _create_and_inject_iframe(); + } + }). + catch(e => console.error('error on check templates url', e)); + } } + + _check_url_avail(); + + CommonEvents.on('panel:show', panel => { + if ( !iframe && panel == this.action ) { + _check_url_avail(); + } + }); + + CommonEvents.on('lang:changed', (old, newlang) => { + window.errorBox.translate(newlang); + + if ( !!iframe ) { + // iframe.contentWindow.postMessage(JSON.stringify({lang: newlang})); + _remove_frame(this.view.emptyPanelContent); + _check_url_avail(); + } + }); + + CommonEvents.on('theme:changed', (theme, type) => { + if ( !!iframe ) { + // iframe.contentWindow.postMessage(JSON.stringify({theme: {name: theme, type: type}})); + _remove_frame(this.view.emptyPanelContent); + _check_url_avail(); + } + }); } - _check_url_avail(); - - CommonEvents.on('panel:show', panel => { - if ( !iframe && panel == this.action ) { - _check_url_avail(); - } - }); - - CommonEvents.on('lang:changed', (old, newlang) => { - window.errorBox.translate(newlang); - - if ( !!iframe ) { - // iframe.contentWindow.postMessage(JSON.stringify({lang: newlang})); - _remove_frame(this.view.emptyPanelContent); - _check_url_avail(); - } - }); - - CommonEvents.on('theme:changed', (theme, type) => { - if ( !!iframe ) { - // iframe.contentWindow.postMessage(JSON.stringify({theme: {name: theme, type: type}})); - _remove_frame(this.view.emptyPanelContent); - _check_url_avail(); - } - }); - // if ( !!localStorage.templatespanel ) { // let iframe; // if ( navigator.onLine ) { diff --git a/common/loginpage/src/styles.less b/common/loginpage/src/styles.less index 2828209e5..7bd381e80 100644 --- a/common/loginpage/src/styles.less +++ b/common/loginpage/src/styles.less @@ -1404,6 +1404,19 @@ li.menu-item { flex-wrap: wrap; gap: 10px 5px; } + + &.win_xp { + .icon { + .box { + left: 0; + transform: none; + } + + display: flex; + flex-direction: column; + align-items: center; + } + } } #idx-update-cnt {