Merge pull request #90 from ONLYOFFICE/feature/bugfix5.1.3

Feature/bugfix5.1.3
This commit is contained in:
Alexey Golubev 2018-04-18 15:36:17 +03:00 committed by GitHub
commit 3740ba637f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 35 additions and 65 deletions

View file

@ -674,7 +674,7 @@ define([
};
btn.setDisabled( true );
} else {
btn.setDisabled( btn.keepState.disabled );
btn.setDisabled( btn.keepState && btn.keepState.disabled || lock);
delete btn.keepState;
}
}

View file

@ -193,7 +193,6 @@ define([
$('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode'));
$('#settings-search').single('click', _.bind(me.onSearch, me));
$('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me));
$('#settings-edit-document').single('click', _.bind(me.onEditDocumet, me));
$('#settings-help').single('click', _.bind(me.onShowHelp, me));
$('#settings-download').single('click', _.bind(me.onDownloadOrigin, me));
}
@ -267,10 +266,6 @@ define([
// Handlers
onEditDocumet: function() {
Common.Gateway.requestEditRights();
},
onSearch: function (e) {
var toolbarView = DE.getController('Toolbar').getView('Toolbar');

View file

@ -25,18 +25,6 @@
</a>
</li>
<% } %>
<li>
<a id="settings-edit-document" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-edit"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textEditDoc %></div>
</div>
</div>
</a>
</li>
<li>
<div id="settings-readermode" class="item-content">
<div class="item-media">

View file

@ -34,6 +34,9 @@
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
<i class="icon icon-plus"></i>
</a>
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
<i class="icon icon-edit"></i>
</a>
<% if (!phone) { %>
<a href="#" id="toolbar-search" class="link icon-only">
<i class="icon icon-search"></i>

View file

@ -108,10 +108,8 @@ define([
isPhone = Common.SharedSettings.get('phone');
if (_isEdit) {
$layour.find('#settings-edit-document').hide();
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
} else {
if (!_canEdit) $layour.find('#settings-edit-document').hide();
$layour.find('#settings-document').hide();
}
if (!_canReader)
@ -213,7 +211,6 @@ define([
permissions = _.extend(permissions, data.doc.permissions);
if (permissions.edit === false) {
$('#settings-edit-document').hide();
}
}
},

View file

@ -62,7 +62,8 @@ define([
"click #toolbar-search" : "searchToggle",
"click #toolbar-edit" : "showEdition",
"click #toolbar-add" : "showInserts",
"click #toolbar-settings" : "showSettings"
"click #toolbar-settings" : "showSettings",
"click #toolbar-edit-document": "editDocument"
},
// Set innerHTML and get the references to the DOM elements
@ -100,6 +101,8 @@ define([
setMode: function (mode) {
if (mode.isEdit) {
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
} else if (mode.canEdit && mode.canRequestEditRights){
$('#toolbar-edit-document').show();
}
},
@ -147,6 +150,10 @@ define([
DE.getController('Settings').showModal();
},
editDocument: function () {
Common.Gateway.requestEditRights();
},
textBack: 'Back'
}
})(), DE.Views.Toolbar || {}))

View file

@ -155,7 +155,6 @@ define([
var me = this;
$('#settings-search').single('click', _.bind(me._onSearch, me));
$('#settings-readermode input:checkbox').single('change', _.bind(me._onReaderMode, me));
$('#settings-edit-presentation').single('click', _.bind(me._onEditPresentation, me));
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
$('#page-settings-setup-view li').single('click', _.bind(me._onSlideSize, me));
@ -224,10 +223,6 @@ define([
$('#settings-presentation-title').html(name ? name : '-');
},
_onEditPresentation: function() {
Common.Gateway.requestEditRights();
},
_onSearch: function (e) {
var toolbarView = PE.getController('Toolbar').getView('Toolbar');

View file

@ -25,18 +25,6 @@
</a>
</li>
<% } %>
<li>
<a id="settings-edit-presentation" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-edit"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textEditPresent %></div>
</div>
</div>
</a>
</li>
<li>
<a id="settings-presentation-setup" class="item-link">
<div class="item-content">

View file

@ -37,6 +37,9 @@
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
<i class="icon icon-plus"></i>
</a>
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
<i class="icon icon-edit"></i>
</a>
<% if (!phone) { %>
<a href="#" id="toolbar-search" class="link icon-only">
<i class="icon icon-search"></i>

View file

@ -109,11 +109,9 @@ define([
isPhone = Common.SharedSettings.get('phone');
if (isEdit) {
$layour.find('#settings-edit-presentation').hide();
$layour.find('#settings-readermode').hide();
$layour.find('#settings-search .item-title').text(this.textFindAndReplace)
} else {
if (!canEdit) $layour.find('#settings-edit-presentation').hide();
$layour.find('#settings-presentation-setup').hide();
$layour.find('#settings-readermode input:checkbox')
.attr('checked', Common.SharedSettings.get('readerMode'))
@ -190,7 +188,6 @@ define([
permissions = _.extend(permissions, data.doc.permissions);
if (permissions.edit === false) {
$('#settings-edit-presentation').hide();
}
}
},

View file

@ -63,7 +63,8 @@ define([
"click #toolbar-edit" : "showEdition",
"click #toolbar-add" : "showInserts",
"click #toolbar-settings" : "showSettings",
"click #toolbar-preview" : "showPreview"
"click #toolbar-preview" : "showPreview",
"click #toolbar-edit-document": "editDocument"
},
// Set innerHTML and get the references to the DOM elements
@ -101,6 +102,8 @@ define([
setMode: function (mode) {
if (mode.isEdit) {
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
} else if (mode.canEdit && mode.canRequestEditRights){
$('#toolbar-edit-document').show();
}
},
@ -152,6 +155,10 @@ define([
PE.getController('DocumentPreview').show();
},
editDocument: function () {
Common.Gateway.requestEditRights();
},
textBack: 'Back'
}
})(), PE.Views.Toolbar || {}))

View file

@ -872,7 +872,6 @@ define([
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canRename = !!this.permissions.rename;
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false);
this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object');
if (this.appOptions.canBranding)
@ -897,6 +896,7 @@ define([
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge);
this.applyModeCommonElements();
this.applyModeEditorElements();

View file

@ -148,7 +148,6 @@ define([
onPageShow: function(view, pageId) {
var me = this;
$('#settings-search').single('click', _.bind(me._onSearch, me));
$('#settings-edit-document').single('click', _.bind(me._onEditDocument, me));
$(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me));
me.initSettings(pageId);
},
@ -200,10 +199,6 @@ define([
// API handlers
_onEditDocument: function() {
Common.Gateway.requestEditRights();
},
_onSearch: function (e) {
var toolbarView = SSE.getController('Toolbar').getView('Toolbar');

View file

@ -25,18 +25,6 @@
</a>
</li>
<% } %>
<li>
<a id="settings-edit-document" class="item-link no-indicator">
<div class="item-content">
<div class="item-media">
<i class="icon icon-edit"></i>
</div>
<div class="item-inner">
<div class="item-title"><%= scope.textEditDoc %></div>
</div>
</div>
</a>
</li>
<li>
<a id="settings-download" class="item-link">
<div class="item-content">

View file

@ -34,6 +34,9 @@
<a href="#" id="toolbar-add" class="link icon-only" style="display: none;">
<i class="icon icon-plus"></i>
</a>
<a href="#" id="toolbar-edit-document" class="link icon-only" style="display: none;">
<i class="icon icon-edit"></i>
</a>
<% if (!phone) { %>
<a href="#" id="toolbar-search" class="link icon-only">
<i class="icon icon-search"></i>

View file

@ -114,10 +114,8 @@ define([
isPhone = Common.SharedSettings.get('phone');
if (isEdit) {
$layout.find('#settings-edit-document').hide();
$layout.find('#settings-search .item-title').text(this.textFindAndReplace)
} else {
if (!canEdit) $layout.find('#settings-edit-document').hide();
}
if (!canDownload) $layout.find('#settings-download').hide();
if (!canAbout) $layout.find('#settings-about').hide();
@ -185,7 +183,6 @@ define([
permissions = _.extend(permissions, data.doc.permissions);
if (permissions.edit === false) {
$('#settings-edit-document').hide();
}
}
},

View file

@ -62,7 +62,8 @@ define([
"click #toolbar-search" : "searchToggle",
"click #toolbar-edit" : "showEdition",
"click #toolbar-add" : "showInserts",
"click #toolbar-settings" : "showSettings"
"click #toolbar-settings" : "showSettings",
"click #toolbar-edit-document": "editDocument"
},
// Set innerHTML and get the references to the DOM elements
@ -93,6 +94,8 @@ define([
setMode: function (mode) {
if (mode.isEdit) {
$('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show();
} else if (mode.canEdit && mode.canRequestEditRights){
$('#toolbar-edit-document').show();
}
},
@ -148,6 +151,10 @@ define([
this.$btnEdit.toggleClass('disabled', val);
},
editDocument: function () {
Common.Gateway.requestEditRights();
},
textBack: 'Back'
}
})(), SSE.Views.Toolbar || {}))