[DE mobile] Fix bug 45472

This commit is contained in:
JuliaSvinareva 2020-05-27 17:03:14 +03:00
parent a626ca471d
commit 485c31bc80
3 changed files with 29 additions and 11 deletions

View file

@ -91,10 +91,13 @@ define([
},
initEvents: function () {
this.view.hideInsertComments = this.isHideInsertComment();
this.setDisableMenuItem();
},
isHideInsertComment: function() {
setDisableMenuItem: function() {
var isDisableComment = true,
isDisableBreak = false,
isDisableFootnote = false;
var stack = this.api.getSelectedElements();
var isText = false,
isTable = false,
@ -133,9 +136,14 @@ define([
});
if (stack.length > 0) {
var isObject = isShape || isChart || isImage || isTable;
return (this.api.can_AddQuotedComment() === false || lockedText || lockedTable || lockedImage || lockedHeader || (!isText && isObject));
isDisableComment = (this.api.can_AddQuotedComment() === false || lockedText || lockedTable || lockedImage || lockedHeader || (!isText && isObject));
if (isShape && isText) {
isDisableBreak = isDisableFootnote = true;
}
return true;
}
this.view.isDisableComment = isDisableComment;
this.view.isDisableBreak = isDisableBreak;
this.view.isDisableFootnote = isDisableFootnote;
},
onPageShow: function (view, pageId) {

View file

@ -38,7 +38,7 @@
</div>
</a>
</li>
<li>
<li id="item-break">
<a id="add-other-break" class="item-link">
<div class="item-content">
<div class="item-media">
@ -50,7 +50,7 @@
</div>
</a>
</li>
<li>
<li id="item-footnote">
<a id="add-other-footnote" class="item-link">
<div class="item-content">
<div class="item-media">

View file

@ -68,14 +68,24 @@ define([
$('#add-other-link').single('click', _.bind(me.showLink, me));
$('#add-other-pagenumber').single('click', _.bind(me.showPagePosition, me));
$('#add-other-footnote').single('click', _.bind(me.showPageFootnote, me));
$('#add-other-break').single('click', _.bind(me.showPageBreak, me));
if (this.hideInsertComments) {
$('#item-comment').hide();
if (this.isDisableComment) {
$('#item-comment').addClass('disabled');
} else {
$('#item-comment').show();
$('#item-comment').removeClass('disabled');
$('#add-other-comment').single('click', _.bind(me.showPageComment, me));
}
if (this.isDisableBreak) {
$('#item-break').addClass('disabled');
} else {
$('#item-break').removeClass('disabled');
$('#add-other-break').single('click', _.bind(me.showPageBreak, me));
}
if (this.isDisableFootnote) {
$('#item-footnote').addClass('disabled');
} else {
$('#item-footnote').removeClass('disabled');
$('#add-other-footnote').single('click', _.bind(me.showPageFootnote, me));
}
me.initControls();
},