Merge branch 'develop' of https://github.com/ONLYOFFICE/web-apps into develop

This commit is contained in:
Maxim Kadushkin 2020-04-22 16:41:16 +03:00
commit d466ed1201
31 changed files with 65 additions and 46 deletions

View file

@ -901,3 +901,20 @@ Common.Utils.InternalSettings.set('window-inactive-area-top', 0);
Common.Utils.InternalSettings.set('toolbar-height-compact', Common.Utils.InternalSettings.get('toolbar-height-tabs')); Common.Utils.InternalSettings.set('toolbar-height-compact', Common.Utils.InternalSettings.get('toolbar-height-tabs'));
Common.Utils.InternalSettings.set('toolbar-height-normal', Common.Utils.InternalSettings.get('toolbar-height-tabs') + Common.Utils.InternalSettings.get('toolbar-height-controls')); Common.Utils.InternalSettings.set('toolbar-height-normal', Common.Utils.InternalSettings.get('toolbar-height-tabs') + Common.Utils.InternalSettings.get('toolbar-height-controls'));
Common.Utils.ModalWindow = new(function() {
var count = 0;
return {
show: function() {
count++;
},
close: function() {
count--;
},
isVisible: function() {
return count>0;
}
}
})();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 B

View file

@ -108,4 +108,8 @@ textarea.form-control:focus {
right: 22px; right: 22px;
} }
} }
input {
padding-right: 20px;
}
} }

View file

@ -157,7 +157,7 @@ define([
this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false}; this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false};
this.languages = null; this.languages = null;
this.isModalShowed = 0;
// Initialize viewport // Initialize viewport
if (!Common.Utils.isBrowserSupported()){ if (!Common.Utils.isBrowserSupported()){
@ -229,13 +229,13 @@ define([
me.beforeShowDummyComment = me.beforeCloseDummyComment = false; me.beforeShowDummyComment = me.beforeCloseDummyComment = false;
} else if (/textarea-control/.test(e.target.className)) } else if (/textarea-control/.test(e.target.className))
me.inTextareaControl = true; me.inTextareaControl = true;
else if (!me.isModalShowed && /form-control/.test(e.target.className)) else if (!Common.Utils.ModalWindow.isVisible() && /form-control/.test(e.target.className))
me.inFormControl = true; me.inFormControl = true;
} }
}); });
$(document.body).on('blur', 'input, textarea', function(e) { $(document.body).on('blur', 'input, textarea', function(e) {
if (!me.isModalShowed) { if (!Common.Utils.ModalWindow.isVisible()) {
if (/form-control/.test(e.target.className)) if (/form-control/.test(e.target.className))
me.inFormControl = false; me.inFormControl = false;
if (me.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file').isVisible()) if (me.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file').isVisible())
@ -283,31 +283,31 @@ define([
Common.NotificationCenter.on({ Common.NotificationCenter.on({
'modal:show': function(){ 'modal:show': function(){
me.isModalShowed++; Common.Utils.ModalWindow.show();
me.api.asc_enableKeyEvents(false); me.api.asc_enableKeyEvents(false);
}, },
'modal:close': function(dlg) { 'modal:close': function(dlg) {
me.isModalShowed--; Common.Utils.ModalWindow.close();
if (!me.isModalShowed) if (!Common.Utils.ModalWindow.isVisible())
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'modal:hide': function(dlg) { 'modal:hide': function(dlg) {
me.isModalShowed--; Common.Utils.ModalWindow.close();
if (!me.isModalShowed) if (!Common.Utils.ModalWindow.isVisible())
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'settings:unitschanged':_.bind(this.unitsChanged, this), 'settings:unitschanged':_.bind(this.unitsChanged, this),
'dataview:focus': function(e){ 'dataview:focus': function(e){
}, },
'dataview:blur': function(e){ 'dataview:blur': function(e){
if (!me.isModalShowed) { if (!Common.Utils.ModalWindow.isVisible()) {
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
} }
}, },
'menu:show': function(e){ 'menu:show': function(e){
}, },
'menu:hide': function(e, isFromInputControl){ 'menu:hide': function(e, isFromInputControl){
if (!me.isModalShowed && !isFromInputControl) if (!Common.Utils.ModalWindow.isVisible() && !isFromInputControl)
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'edit:complete': _.bind(me.onEditComplete, me) 'edit:complete': _.bind(me.onEditComplete, me)
@ -754,7 +754,7 @@ define([
if ( type == Asc.c_oAscAsyncActionType.BlockInteraction && if ( type == Asc.c_oAscAsyncActionType.BlockInteraction &&
(!this.getApplication().getController('LeftMenu').dlgSearch || !this.getApplication().getController('LeftMenu').dlgSearch.isVisible()) && (!this.getApplication().getController('LeftMenu').dlgSearch || !this.getApplication().getController('LeftMenu').dlgSearch.isVisible()) &&
(!this.getApplication().getController('Toolbar').dlgSymbolTable || !this.getApplication().getController('Toolbar').dlgSymbolTable.isVisible()) && (!this.getApplication().getController('Toolbar').dlgSymbolTable || !this.getApplication().getController('Toolbar').dlgSymbolTable.isVisible()) &&
!((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.inTextareaControl || this.isModalShowed || this.inFormControl)) ) { !((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.inTextareaControl || Common.Utils.ModalWindow.isVisible() || this.inFormControl)) ) {
// this.onEditComplete(this.loadMask); //если делать фокус, то при принятии чужих изменений, заканчивается свой композитный ввод // this.onEditComplete(this.loadMask); //если делать фокус, то при принятии чужих изменений, заканчивается свой композитный ввод
this.api.asc_enableKeyEvents(true); this.api.asc_enableKeyEvents(true);
} }
@ -2140,7 +2140,7 @@ define([
}, },
onPrint: function() { onPrint: function() {
if (!this.appOptions.canPrint || this.isModalShowed) return; if (!this.appOptions.canPrint || Common.Utils.ModalWindow.isVisible()) return;
if (this.api) if (this.api)
this.api.asc_Print(new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera)); // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event this.api.asc_Print(new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera)); // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event

View file

@ -420,7 +420,7 @@ define([
}, },
onApiChangeFont: function(font) { onApiChangeFont: function(font) {
!this.getApplication().getController('Main').isModalShowed && this.toolbar.cmbFontName.onApiChangeFont(font); !Common.Utils.ModalWindow.isVisible() && this.toolbar.cmbFontName.onApiChangeFont(font);
}, },
onApiFontSize: function(size) { onApiFontSize: function(size) {
@ -1232,7 +1232,7 @@ define([
onFontNameSelect: function(combo, record) { onFontNameSelect: function(combo, record) {
if (this.api) { if (this.api) {
if (record.isNewFont) { if (record.isNewFont) {
!this.getApplication().getController('Main').isModalShowed && !Common.Utils.ModalWindow.isVisible() &&
Common.UI.warning({ Common.UI.warning({
width: 500, width: 500,
closable: false, closable: false,

View file

@ -133,7 +133,7 @@ define([
this.btnContentsUpdate = new Common.UI.Button({ this.btnContentsUpdate = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-contents-update', iconCls: 'toolbar__icon btn-update',
caption: this.capBtnContentsUpdate, caption: this.capBtnContentsUpdate,
split: true, split: true,
menu: true, menu: true,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 B

View file

@ -135,7 +135,6 @@ define([
this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false}; this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false};
this.languages = null; this.languages = null;
this.isModalShowed = 0;
window.storagename = 'presentation'; window.storagename = 'presentation';
@ -204,13 +203,13 @@ define([
me.dontCloseDummyComment = true; me.dontCloseDummyComment = true;
else if (/textarea-control/.test(e.target.className)) else if (/textarea-control/.test(e.target.className))
me.inTextareaControl = true; me.inTextareaControl = true;
else if (!me.isModalShowed && /form-control/.test(e.target.className)) else if (!Common.Utils.ModalWindow.isVisible() && /form-control/.test(e.target.className))
me.inFormControl = true; me.inFormControl = true;
} }
}); });
$(document.body).on('blur', 'input, textarea', function(e) { $(document.body).on('blur', 'input, textarea', function(e) {
if (!me.isModalShowed) { if (!Common.Utils.ModalWindow.isVisible()) {
if (/form-control/.test(e.target.className)) if (/form-control/.test(e.target.className))
me.inFormControl = false; me.inFormControl = false;
if (me.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file').isVisible()) if (me.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file').isVisible())
@ -250,31 +249,31 @@ define([
Common.NotificationCenter.on({ Common.NotificationCenter.on({
'modal:show': function(e){ 'modal:show': function(e){
me.isModalShowed++; Common.Utils.ModalWindow.show();
me.api.asc_enableKeyEvents(false); me.api.asc_enableKeyEvents(false);
}, },
'modal:close': function(dlg) { 'modal:close': function(dlg) {
me.isModalShowed--; Common.Utils.ModalWindow.close();
if (!me.isModalShowed) if (!Common.Utils.ModalWindow.isVisible())
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'modal:hide': function(dlg) { 'modal:hide': function(dlg) {
me.isModalShowed--; Common.Utils.ModalWindow.close();
if (!me.isModalShowed) if (!Common.Utils.ModalWindow.isVisible())
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'settings:unitschanged':_.bind(this.unitsChanged, this), 'settings:unitschanged':_.bind(this.unitsChanged, this),
'dataview:focus': function(e){ 'dataview:focus': function(e){
}, },
'dataview:blur': function(e){ 'dataview:blur': function(e){
if (!me.isModalShowed) { if (!Common.Utils.ModalWindow.isVisible()) {
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
} }
}, },
'menu:show': function(e){ 'menu:show': function(e){
}, },
'menu:hide': function(e, isFromInputControl){ 'menu:hide': function(e, isFromInputControl){
if (!me.isModalShowed && !isFromInputControl) if (!Common.Utils.ModalWindow.isVisible() && !isFromInputControl)
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'edit:complete': _.bind(me.onEditComplete, me) 'edit:complete': _.bind(me.onEditComplete, me)
@ -517,7 +516,7 @@ define([
if (this.appOptions.isEdit && (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) && (!this._state.fastCoauth || this._state.usersCount<2)) if (this.appOptions.isEdit && (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) && (!this._state.fastCoauth || this._state.usersCount<2))
this.synchronizeChanges(); this.synchronizeChanges();
if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.inTextareaControl || this.isModalShowed || this.inFormControl))) { if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !((id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.inTextareaControl || Common.Utils.ModalWindow.isVisible() || this.inFormControl))) {
this.onEditComplete(this.loadMask); this.onEditComplete(this.loadMask);
this.api.asc_enableKeyEvents(true); this.api.asc_enableKeyEvents(true);
} }
@ -1796,7 +1795,7 @@ define([
}, },
onPrint: function() { onPrint: function() {
if (!this.appOptions.canPrint || this.isModalShowed) return; if (!this.appOptions.canPrint || Common.Utils.ModalWindow.isVisible()) return;
if (this.api) if (this.api)
this.api.asc_Print(new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera)); // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event this.api.asc_Print(new Asc.asc_CDownloadOptions(null, Common.Utils.isChrome || Common.Utils.isSafari || Common.Utils.isOpera)); // if isChrome or isSafari or isOpera == true use asc_onPrintUrl event

View file

@ -396,7 +396,7 @@ define([
}, },
onApiChangeFont: function(font) { onApiChangeFont: function(font) {
!this.getApplication().getController('Main').isModalShowed && this.toolbar.cmbFontName.onApiChangeFont(font); !Common.Utils.ModalWindow.isVisible() && this.toolbar.cmbFontName.onApiChangeFont(font);
}, },
onApiFontSize: function(size) { onApiFontSize: function(size) {
@ -1154,7 +1154,7 @@ define([
onFontNameSelect: function(combo, record) { onFontNameSelect: function(combo, record) {
if (this.api) { if (this.api) {
if (record.isNewFont) { if (record.isNewFont) {
!this.getApplication().getController('Main').isModalShowed && !Common.Utils.ModalWindow.isVisible() &&
Common.UI.warning({ Common.UI.warning({
width: 500, width: 500,
closable: false, closable: false,

View file

@ -149,7 +149,6 @@ define([
var me = this; var me = this;
this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false}; this._state = {isDisconnected: false, usersCount: 1, fastCoauth: true, lostEditingRights: false, licenseType: false};
this.isModalShowed = 0;
if (!Common.Utils.isBrowserSupported()){ if (!Common.Utils.isBrowserSupported()){
Common.Utils.showBrowserRestriction(); Common.Utils.showBrowserRestriction();
@ -218,7 +217,7 @@ define([
me.dontCloseDummyComment = true; me.dontCloseDummyComment = true;
else if (/textarea-control/.test(e.target.className)) else if (/textarea-control/.test(e.target.className))
me.inTextareaControl = true; me.inTextareaControl = true;
else if (!me.isModalShowed && /form-control/.test(e.target.className)) else if (!Common.Utils.ModalWindow.isVisible() && /form-control/.test(e.target.className))
me.inFormControl = true; me.inFormControl = true;
} }
}); });
@ -226,7 +225,7 @@ define([
$(document.body).on('blur', 'input, textarea', function(e) { $(document.body).on('blur', 'input, textarea', function(e) {
if (me.isAppDisabled === true || me.isFrameClosed) return; if (me.isAppDisabled === true || me.isFrameClosed) return;
if ((!me.isModalShowed || $('.asc-window.enable-key-events:visible').length>0) && !(me.loadMask && me.loadMask.isVisible())) { if ((!Common.Utils.ModalWindow.isVisible() || $('.asc-window.enable-key-events:visible').length>0) && !(me.loadMask && me.loadMask.isVisible())) {
if (/form-control/.test(e.target.className)) if (/form-control/.test(e.target.className))
me.inFormControl = false; me.inFormControl = false;
if (me.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file').isVisible()) if (me.getApplication().getController('LeftMenu').getView('LeftMenu').getMenu('file').isVisible())
@ -266,30 +265,30 @@ define([
Common.NotificationCenter.on({ Common.NotificationCenter.on({
'modal:show': function(e){ 'modal:show': function(e){
me.isModalShowed++; Common.Utils.ModalWindow.show();
me.api.asc_enableKeyEvents(false); me.api.asc_enableKeyEvents(false);
}, },
'modal:close': function(dlg) { 'modal:close': function(dlg) {
me.isModalShowed--; Common.Utils.ModalWindow.close();
if (!me.isModalShowed) if (!Common.Utils.ModalWindow.isVisible())
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'modal:hide': function(dlg) { 'modal:hide': function(dlg) {
me.isModalShowed--; Common.Utils.ModalWindow.close();
if (!me.isModalShowed) if (!Common.Utils.ModalWindow.isVisible())
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
}, },
'dataview:focus': function(e){ 'dataview:focus': function(e){
}, },
'dataview:blur': function(e){ 'dataview:blur': function(e){
if (!me.isModalShowed) { if (!Common.Utils.ModalWindow.isVisible()) {
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
} }
}, },
'menu:show': function(e){ 'menu:show': function(e){
}, },
'menu:hide': function(menu, isFromInputControl){ 'menu:hide': function(menu, isFromInputControl){
if (!me.isModalShowed && (!menu || !menu.cmpEl.hasClass('from-cell-edit')) && !isFromInputControl) { if (!Common.Utils.ModalWindow.isVisible() && (!menu || !menu.cmpEl.hasClass('from-cell-edit')) && !isFromInputControl) {
me.api.asc_InputClearKeyboardElement(); me.api.asc_InputClearKeyboardElement();
me.api.asc_enableKeyEvents(true); me.api.asc_enableKeyEvents(true);
} }
@ -565,12 +564,12 @@ define([
this.setLongActionView(action); this.setLongActionView(action);
} else { } else {
if (this.loadMask) { if (this.loadMask) {
if (this.loadMask.isVisible() && !this.dontCloseDummyComment && !this.inTextareaControl && !this.isModalShowed && !this.inFormControl) if (this.loadMask.isVisible() && !this.dontCloseDummyComment && !this.inTextareaControl && !Common.Utils.ModalWindow.isVisible() && !this.inFormControl)
this.api.asc_enableKeyEvents(true); this.api.asc_enableKeyEvents(true);
this.loadMask.hide(); this.loadMask.hide();
} }
if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !( (id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.inTextareaControl || this.isModalShowed || this.inFormControl) )) if (type == Asc.c_oAscAsyncActionType.BlockInteraction && !( (id == Asc.c_oAscAsyncAction['LoadDocumentFonts'] || id == Asc.c_oAscAsyncAction['ApplyChanges']) && (this.dontCloseDummyComment || this.inTextareaControl || Common.Utils.ModalWindow.isVisible() || this.inFormControl) ))
this.onEditComplete(this.loadMask, {restorefocus:true}); this.onEditComplete(this.loadMask, {restorefocus:true});
} }
}, },
@ -1959,7 +1958,7 @@ define([
this.isAppDisabled = data.data; this.isAppDisabled = data.data;
break; break;
case 'queryClose': case 'queryClose':
if ($('body .asc-window:visible').length === 0) { if (!Common.Utils.ModalWindow.isVisible()) {
this.isFrameClosed = true; this.isFrameClosed = true;
this.api.asc_closeCellEditor(); this.api.asc_closeCellEditor();
Common.UI.Menu.Manager.hideAll(); Common.UI.Menu.Manager.hideAll();
@ -2130,7 +2129,7 @@ define([
}, },
onPrint: function() { onPrint: function() {
if (!this.appOptions.canPrint || this.isModalShowed) return; if (!this.appOptions.canPrint || Common.Utils.ModalWindow.isVisible()) return;
Common.NotificationCenter.trigger('print', this); Common.NotificationCenter.trigger('print', this);
}, },

View file

@ -425,7 +425,7 @@ define([
// }, // },
onApiChangeFont: function(font) { onApiChangeFont: function(font) {
!this.getApplication().getController('Main').isModalShowed && this.toolbar.cmbFontName.onApiChangeFont(font); !Common.Utils.ModalWindow.isVisible() && this.toolbar.cmbFontName.onApiChangeFont(font);
}, },
onContextMenu: function() { onContextMenu: function() {
@ -1353,7 +1353,7 @@ define([
onFontNameSelect: function(combo, record) { onFontNameSelect: function(combo, record) {
if (this.api) { if (this.api) {
if (record.isNewFont) { if (record.isNewFont) {
!this.getApplication().getController('Main').isModalShowed && !Common.Utils.ModalWindow.isVisible() &&
Common.UI.warning({ Common.UI.warning({
width: 500, width: 500,
closable: false, closable: false,

View file

@ -228,7 +228,7 @@ define([
this.btnRefreshPivot = new Common.UI.Button({ this.btnRefreshPivot = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top', cls: 'btn-toolbar x-huge icon-top',
iconCls: 'toolbar__icon btn-update-pivot', iconCls: 'toolbar__icon btn-update',
caption: this.txtRefresh, caption: this.txtRefresh,
disabled : true, disabled : true,
lock : [_set.lostConnect, _set.coAuth, _set.noPivot] lock : [_set.lostConnect, _set.coAuth, _set.noPivot]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 B