UI.prototype.popup = function (text, callback) {
var i, popup = $("#popup"),
buttons = {'Cancel': function () { $("#popup").popup('close') }};
- // to hide default button give {'Close': false} in callback
+ // to hide default button give {'Cancel': false} in callback
+
+ // N_SE-49979 workaround to lock forbidden keys
+ this.lockTabKey();
for (i in callback) {
if (callback.hasOwnProperty(i)) {
popup.trigger("create");
popup.popup('open', {positionTo: 'window'});
+
+ // N_SE-49979 workaround to unlock forbidden keys
+ popup.one("popupafterclose", function () {
+ $(document).off('keydown');
+ });
+ };
+
+ UI.prototype.lockTabKey = function () {
+ var key;
+ $(document).on('keydown', function(event) {
+ key = event.keyCode;
+ if (key === 9 || key === 38 || key === 40) {
+ event.preventDefault();
+ }
+ });
};
UI.prototype.clearTabbars = function () {