Update autocomplete.js

Fix typeerror "Cannot read property 'container' of undefined" when using live autocomplete. Error can occur when editor loses focus and the autocomplete popup has never been shown.
This commit is contained in:
trystanclarke 2015-02-27 16:15:24 +00:00
commit ae4989eea1

View file

@ -143,7 +143,7 @@ var Autocomplete = function() {
// on IE preventDefault doesn't stop scrollbar from being focussed
var el = document.activeElement;
var text = this.editor.textInput.getElement()
if (el != text && el.parentNode != this.popup.container
if (el != text && this.popup && el.parentNode != this.popup.container
&& el != this.tooltipNode && e.relatedTarget != this.tooltipNode
&& e.relatedTarget != text
) {