From ab44158ee682cc5d31e23945104f491efdeac625 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Sat, 21 Sep 2019 11:51:15 +0300 Subject: [PATCH] [DE] Caption Dialog --- .../main/app/view/CaptionDialog.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/view/CaptionDialog.js b/apps/documenteditor/main/app/view/CaptionDialog.js index 3085b33c3..bf8d97d39 100644 --- a/apps/documenteditor/main/app/view/CaptionDialog.js +++ b/apps/documenteditor/main/app/view/CaptionDialog.js @@ -387,7 +387,7 @@ define([ }, onPrimary: function() { - this._handleInput('insert'); + this._handleInput('ok'); return false; }, @@ -412,6 +412,16 @@ define([ setTimeout(function () { event.target.selectionStart = me.positionCaption; }, 0); + } else if (event.target.selectionStart !== event.target.selectionEnd && key === 'ArrowRight') { + if (event.target.selectionEnd > me.positionCaption) { + setTimeout(function () { + event.target.selectionStart = event.target.selectionEnd; + }, 0); + } else { + setTimeout(function () { + event.target.selectionStart = me.positionCaption; + }, 0); + } } else if (key === 'Backspace') { if ((event.target.selectionStart === event.target.selectionEnd && event.target.selectionStart < me.positionCaption + 1) || event.target.selectionStart < me.positionCaption - 1) { event.preventDefault(); @@ -420,7 +430,7 @@ define([ if (event.target.selectionStart < me.positionCaption - 1) { event.preventDefault(); } - } else { + } else if (key !== 'End') { if (event.target.selectionStart !== event.target.selectionEnd && event.target.selectionStart === 0) { event.preventDefault(); } @@ -449,7 +459,7 @@ define([ textFigure: 'Figure', textTable: 'Table', textExclude: 'Exclude label from caption', - textLabelError: 'The entered value is incorrect.' + textLabelError: 'Label must not be empty.' }, DE.Views.CaptionDialog || {})) }); \ No newline at end of file