Merge pull request #1380 from ONLYOFFICE/fix/fix-bugs

Fix/fix bugs
This commit is contained in:
Julia Radzhabova 2021-12-03 17:16:09 +03:00 committed by GitHub
commit 26522d4036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 19 deletions

View file

@ -446,7 +446,8 @@ Common.UI.HintManager = new(function() {
}
}, 10);
} else {
var curLetter = null;
var curLetter = null,
match = false;
var keyCode = e.keyCode;
if (keyCode !== 16 && keyCode !== 17 && keyCode !== 18 && keyCode !== 91) {
curLetter = _lang === 'en' ? ((keyCode > 47 && keyCode < 58 || keyCode > 64 && keyCode < 91) ? String.fromCharCode(e.keyCode) : null) : e.key;
@ -462,9 +463,16 @@ Common.UI.HintManager = new(function() {
_inputLetters = _inputLetters + curLetter.toUpperCase();
for (var i = 0; i < _currentControls.length; i++) {
var item = _currentControls[i];
if (!_isItemDisabled(item) && item.attr('data-hint-title') === _inputLetters) {
curr = item;
break;
if (!_isItemDisabled(item)) {
var title = item.attr('data-hint-title'),
regExp = new RegExp('^' + _inputLetters + '');
if (regExp.test(title)) {
match = true;
}
if (title === _inputLetters) {
curr = item;
break;
}
}
}
if (curr) {
@ -501,7 +509,8 @@ Common.UI.HintManager = new(function() {
}
if (curr.prop('id') === 'btn-goback' || curr.closest('.btn-slot').prop('id') === 'slot-btn-options' ||
curr.closest('.btn-slot').prop('id') === 'slot-btn-mode' || curr.prop('id') === 'btn-favorite' || curr.parent().prop('id') === 'tlb-box-users' ||
curr.prop('id') === 'left-btn-thumbs' || curr.hasClass('scroll') || curr.prop('id') === 'left-btn-about') {
curr.prop('id') === 'left-btn-thumbs' || curr.hasClass('scroll') || curr.prop('id') === 'left-btn-about' ||
curr.prop('id') === 'left-btn-support') {
_resetToDefault();
return;
}
@ -516,6 +525,9 @@ Common.UI.HintManager = new(function() {
if (curr.parent().prop('id') === 'slot-btn-chat') {
_nextLevel(1);
_setCurrentSection(undefined, $('#left-menu.hint-section'));
} else if (curr.prop('id') === 'id-right-menu-signature') {
_nextLevel(2);
_setCurrentSection(curr);
} else {
_nextLevel();
_setCurrentSection(curr);
@ -526,6 +538,8 @@ Common.UI.HintManager = new(function() {
}
}
}
} else if (!match) {
_inputLetters = '';
}
}
}

View file

@ -1169,7 +1169,7 @@ define([
this.lblApplication = $markup.findById('#id-info-appname');
this.tblAuthor = $markup.findById('#id-info-author table');
this.trAuthor = $markup.findById('#id-info-add-author').closest('tr');
this.authorTpl = '<tr><td><div style="display: inline-block;width: 200px;"><input type="text" spellcheck="false" class="form-control" readonly="true" value="{0}" ></div><div class="tool close img-commonctrl"></div></td></tr>';
this.authorTpl = '<tr><td><div style="display: inline-block;width: 200px;"><input type="text" spellcheck="false" class="form-control" readonly="true" value="{0}"></div><div class="tool close img-commonctrl" data-hint="2" data-hint-direction="right" data-hint-offset="small"></div></td></tr>';
this.tblAuthor.on('click', function(e) {
var btn = $markup.find(e.target);
@ -1848,8 +1848,8 @@ define([
'<td colspan="2"><label style="cursor: default;"><%= tipText %></label></td>',
'</tr>',
'<tr>',
'<td><label class="link signature-view-link">' + me.txtView + '</label></td>',
'<td align="right"><label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>">' + me.txtEdit + '</label></td>',
'<td><label class="link signature-view-link" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtView + '</label></td>',
'<td align="right"><label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtEdit + '</label></td>',
'</tr>',
'</table>'
].join(''));

View file

@ -214,13 +214,19 @@ define([
this.chAutofit = new Common.UI.CheckBox({
el: $markup.findById('#form-chb-autofit'),
labelText: this.textAutofit
labelText: this.textAutofit,
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.chAutofit.on('change', this.onChAutofit.bind(this));
this.chMulti = new Common.UI.CheckBox({
el: $markup.findById('#form-chb-multiline'),
labelText: this.textMulti
labelText: this.textMulti,
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.chMulti.on('change', this.onChMulti.bind(this));
@ -401,7 +407,10 @@ define([
this.chAspect = new Common.UI.CheckBox({
el: $markup.findById('#form-chb-aspect'),
labelText: this.textAspect
labelText: this.textAspect,
dataHint: '1',
dataHintDirection: 'left',
dataHintOffset: 'small'
});
this.chAspect.on('change', this.onChAspect.bind(this));
@ -413,7 +422,10 @@ define([
data: [{ displayValue: this.textAlways, value: Asc.c_oAscPictureFormScaleFlag.Always },
{ displayValue: this.textNever, value: Asc.c_oAscPictureFormScaleFlag.Never },
{ displayValue: this.textTooBig, value: Asc.c_oAscPictureFormScaleFlag.Bigger },
{ displayValue: this.textTooSmall, value: Asc.c_oAscPictureFormScaleFlag.Smaller }]
{ displayValue: this.textTooSmall, value: Asc.c_oAscPictureFormScaleFlag.Smaller }],
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
this.cmbScale.setValue(Asc.c_oAscPictureFormScaleFlag.Always);
this.lockedControls.push(this.cmbScale);
@ -1150,7 +1162,10 @@ define([
this.btnBGColor = new Common.UI.ColorButton({
parentEl: $('#form-background-color-btn'),
transparent: true,
menu: true
menu: true,
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: 'big'
});
this.lockedControls.push(this.btnBGColor);
this.btnBGColor.on('color:select', _.bind(this.onColorBGSelect, this));

View file

@ -994,7 +994,7 @@ define([
this.lblApplication = $markup.findById('#id-info-appname');
this.tblAuthor = $markup.findById('#id-info-author table');
this.trAuthor = $markup.findById('#id-info-add-author').closest('tr');
this.authorTpl = '<tr><td><div style="display: inline-block;width: 200px;"><input type="text" spellcheck="false" class="form-control" readonly="true" value="{0}" ></div><div class="tool close img-commonctrl"></div></td></tr>';
this.authorTpl = '<tr><td><div style="display: inline-block;width: 200px;"><input type="text" spellcheck="false" class="form-control" readonly="true" value="{0}" ></div><div class="tool close img-commonctrl" data-hint="2" data-hint-direction="right" data-hint-offset="small"></div></td></tr>';
this.tblAuthor.on('click', function(e) {
var btn = $markup.find(e.target);
@ -1584,8 +1584,8 @@ define([
'<td colspan="2"><label style="cursor: default;"><%= tipText %></label></td>',
'</tr>',
'<tr>',
'<td><label class="link signature-view-link">' + me.txtView + '</label></td>',
'<td align="right"><label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>">' + me.txtEdit + '</label></td>',
'<td><label class="link signature-view-link" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtView + '</label></td>',
'<td align="right"><label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtEdit + '</label></td>',
'</tr>',
'</table>'
].join(''));

View file

@ -1957,7 +1957,7 @@ define([
this.lblApplication = $markup.findById('#id-info-appname');
this.tblAuthor = $markup.findById('#id-info-author table');
this.trAuthor = $markup.findById('#id-info-add-author').closest('tr');
this.authorTpl = '<tr><td><div style="display: inline-block;width: 200px;"><input type="text" spellcheck="false" class="form-control" readonly="true" value="{0}" ></div><div class="tool close img-commonctrl"></div></td></tr>';
this.authorTpl = '<tr><td><div style="display: inline-block;width: 200px;"><input type="text" spellcheck="false" class="form-control" readonly="true" value="{0}" ></div><div class="tool close img-commonctrl" data-hint="2" data-hint-direction="right" data-hint-offset="small"></div></td></tr>';
this.tblAuthor.on('click', function(e) {
var btn = $markup.find(e.target);
@ -2546,8 +2546,8 @@ define([
'<td colspan="2"><label style="cursor: default;"><%= tipText %></label></td>',
'</tr>',
'<tr>',
'<td><label class="link signature-view-link">' + me.txtView + '</label></td>',
'<td align="right"><label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>">' + me.txtEdit + '</label></td>',
'<td><label class="link signature-view-link" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtView + '</label></td>',
'<td align="right"><label class="link signature-edit-link <% if (!hasSigned) { %>hidden<% } %>" data-hint="2" data-hint-direction="bottom" data-hint-offset="medium">' + me.txtEdit + '</label></td>',
'</tr>',
'</table>'
].join(''));