Show More
@@ -748,14 +748,22 var IPython = (function (IPython) { | |||
|
748 | 748 | |
|
749 | 749 | KeyboardManager.prototype.register_events = function (e) { |
|
750 | 750 | var that = this; |
|
751 |
|
|
|
751 | var handle_focus = function () { | |
|
752 | 752 | console.log('kb focus in'); |
|
753 | 753 | that.disable(); |
|
754 |
} |
|
|
755 |
|
|
|
754 | }; | |
|
755 | var handle_blur = function () { | |
|
756 | 756 | console.log('kb focus out'); |
|
757 | 757 | that.enable(); |
|
758 |
} |
|
|
758 | }; | |
|
759 | e.on('focusin', handle_focus); | |
|
760 | e.on('focusout', handle_blur); | |
|
761 | // TODO: Very strange. The focusout event does not seem fire for the | |
|
762 | // bootstrap text boxes on FF25&26... | |
|
763 | e.find('*').blur(handle_blur); | |
|
764 | e.on('DOMNodeInserted', function () { | |
|
765 | e.find('*').blur(handle_blur); | |
|
766 | }); | |
|
759 | 767 | // There are times (raw_input) where we remove the element from the DOM before |
|
760 | 768 | // focusout is called. In this case we bind to the remove event of jQueryUI, |
|
761 | 769 | // which gets triggered upon removal, iff it is focused at the time. |
General Comments 0
You need to be logged in to leave comments.
Login now