comparison js/core.js @ 2915:03a66e54cdff

Fix for #161 with popup focus.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Tue, 01 Aug 2017 14:19:45 +0100
parents fc41c3d909b7
children 60e5116da71a
comparison
equal deleted inserted replaced
2914:fc41c3d909b7 2915:03a66e54cdff
553 this.currentIndex = null; 553 this.currentIndex = null;
554 this.node = null; 554 this.node = null;
555 this.store = null; 555 this.store = null;
556 var lastNodeStart; 556 var lastNodeStart;
557 $(window).keypress(function (e) { 557 $(window).keypress(function (e) {
558 if (e.keyCode == 13 && popup.popup.style.visibility == 'visible') { 558 if (e.keyCode == 13 && popup.popup.style.visibility == 'visible' && interfaceContext.lightbox.isVisible() === false) {
559 console.log(e); 559 console.log(e);
560 popup.buttonProceed.onclick(); 560 popup.buttonProceed.onclick();
561 e.preventDefault(); 561 e.preventDefault();
562 } 562 }
563 }); 563 });
2419 this.clear(); 2419 this.clear();
2420 } 2420 }
2421 }, 2421 },
2422 resize: function (event) { 2422 resize: function (event) {
2423 this.root.style.left = (window.innerWidth / 2) - 250 + 'px'; 2423 this.root.style.left = (window.innerWidth / 2) - 250 + 'px';
2424 },
2425 isVisible: function () {
2426 return this.root.style.visibility == "visible";
2424 } 2427 }
2425 }; 2428 };
2426 2429
2427 this.lightbox.root.appendChild(this.lightbox.content); 2430 this.lightbox.root.appendChild(this.lightbox.content);
2428 this.lightbox.root.appendChild(this.lightbox.accept); 2431 this.lightbox.root.appendChild(this.lightbox.accept);