Fix Bug 33431.

This commit is contained in:
Julia Radzhabova 2016-11-17 14:51:36 +03:00
parent daf066c656
commit ca3e9eb589
3 changed files with 33 additions and 6 deletions

View file

@ -314,9 +314,9 @@ define([
return me.txtPageNumInvalid; return me.txtPageNumInvalid;
} }
}).on('keypress:after', function(input, e) { }).on('keypress:after', function(input, e) {
var box = me.$el.find('#status-goto-box');
if (e.keyCode === Common.UI.Keys.RETURN) { 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) { if (!page || page-- > me.pages.get('count') || page < 0) {
edit.select(); edit.select();
return false; return false;
@ -328,6 +328,15 @@ define([
me.api.goToPage(page); me.api.goToPage(page);
me.api.asc_enableKeyEvents(true); 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; return false;
} }
} }

View file

@ -176,9 +176,9 @@ define([
return me.txtPageNumInvalid; return me.txtPageNumInvalid;
} }
}).on('keypress:after', function(input, e) { }).on('keypress:after', function(input, e) {
var box = me.$el.find('#preview-goto-box');
if (e.keyCode === Common.UI.Keys.RETURN) { 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) { if (!page || page-- > me.pages.get('count') || page < 0) {
edit.select(); edit.select();
return false; return false;
@ -190,6 +190,15 @@ define([
me.api.DemonstrationGoToSlide(page); me.api.DemonstrationGoToSlide(page);
me.api.asc_enableKeyEvents(true); 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; return false;
} }
} }

View file

@ -211,9 +211,9 @@ define([
return me.txtPageNumInvalid; return me.txtPageNumInvalid;
} }
}).on('keypress:after', function(input, e) { }).on('keypress:after', function(input, e) {
var box = me.$el.find('#status-goto-box');
if (e.keyCode === Common.UI.Keys.RETURN) { 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) { if (!page || page-- > me.pages.get('count') || page < 0) {
edit.select(); edit.select();
return false; return false;
@ -225,6 +225,15 @@ define([
me.api.goToPage(page); me.api.goToPage(page);
me.api.asc_enableKeyEvents(true); 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; return false;
} }
} }