From ca3e9eb58906a7eacfab03f260bed9ff368964b6 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 17 Nov 2016 14:51:36 +0300 Subject: [PATCH] Fix Bug 33431. --- apps/documenteditor/main/app/view/Statusbar.js | 13 +++++++++++-- .../main/app/view/DocumentPreview.js | 13 +++++++++++-- apps/presentationeditor/main/app/view/Statusbar.js | 13 +++++++++++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index 56875273d..b07ed0447 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -314,9 +314,9 @@ define([ return me.txtPageNumInvalid; } }).on('keypress:after', function(input, e) { - var box = me.$el.find('#status-goto-box'); if (e.keyCode === Common.UI.Keys.RETURN) { - var edit = box.find('input[type=text]'), page = parseInt(edit.val()); + var box = me.$el.find('#status-goto-box'), + edit = box.find('input[type=text]'), page = parseInt(edit.val()); if (!page || page-- > me.pages.get('count') || page < 0) { edit.select(); return false; @@ -328,6 +328,15 @@ define([ me.api.goToPage(page); me.api.asc_enableKeyEvents(true); + return false; + } + } + ).on('keyup:after', function(input, e) { + if (e.keyCode === Common.UI.Keys.ESC) { + var box = me.$el.find('#status-goto-box'); + box.focus(); // for IE + box.parent().removeClass('open'); + me.api.asc_enableKeyEvents(true); return false; } } diff --git a/apps/presentationeditor/main/app/view/DocumentPreview.js b/apps/presentationeditor/main/app/view/DocumentPreview.js index 49f8756a8..711d41367 100644 --- a/apps/presentationeditor/main/app/view/DocumentPreview.js +++ b/apps/presentationeditor/main/app/view/DocumentPreview.js @@ -176,9 +176,9 @@ define([ return me.txtPageNumInvalid; } }).on('keypress:after', function(input, e) { - var box = me.$el.find('#preview-goto-box'); if (e.keyCode === Common.UI.Keys.RETURN) { - var edit = box.find('input[type=text]'), page = parseInt(edit.val()); + var box = me.$el.find('#preview-goto-box'), + edit = box.find('input[type=text]'), page = parseInt(edit.val()); if (!page || page-- > me.pages.get('count') || page < 0) { edit.select(); return false; @@ -190,6 +190,15 @@ define([ me.api.DemonstrationGoToSlide(page); me.api.asc_enableKeyEvents(true); + return false; + } + } + ).on('keyup:after', function(input, e) { + if (e.keyCode === Common.UI.Keys.ESC) { + var box = me.$el.find('#preview-goto-box'); + box.focus(); // for IE + box.parent().removeClass('open'); + me.api.asc_enableKeyEvents(true); return false; } } diff --git a/apps/presentationeditor/main/app/view/Statusbar.js b/apps/presentationeditor/main/app/view/Statusbar.js index 668f2843d..c91b5072c 100644 --- a/apps/presentationeditor/main/app/view/Statusbar.js +++ b/apps/presentationeditor/main/app/view/Statusbar.js @@ -211,9 +211,9 @@ define([ return me.txtPageNumInvalid; } }).on('keypress:after', function(input, e) { - var box = me.$el.find('#status-goto-box'); if (e.keyCode === Common.UI.Keys.RETURN) { - var edit = box.find('input[type=text]'), page = parseInt(edit.val()); + var box = me.$el.find('#status-goto-box'), + edit = box.find('input[type=text]'), page = parseInt(edit.val()); if (!page || page-- > me.pages.get('count') || page < 0) { edit.select(); return false; @@ -225,6 +225,15 @@ define([ me.api.goToPage(page); me.api.asc_enableKeyEvents(true); + return false; + } + } + ).on('keyup:after', function(input, e) { + if (e.keyCode === Common.UI.Keys.ESC) { + var box = me.$el.find('#status-goto-box'); + box.focus(); // for IE + box.parent().removeClass('open'); + me.api.asc_enableKeyEvents(true); return false; } }