+ },
+
+ addIframeListeners : function () {
+ // Add an event handler to each iframe, closing the search window when there's a click inside the iframe
+ // @todo Is there a cleaner way to handle this?
+ var iframes = Ext.query('iframe');
+ Ext.each(iframes, function(item, index, allItems) {
+ item.contentWindow.document.body.onclick = function() {
+ if (parent.TYPO3LiveSearch && parent.TYPO3LiveSearch.hasFocus) {
+ if (parent.TYPO3LiveSearch.isExpanded()) {
+ parent.TYPO3LiveSearch.collapse();
+ }
+
+ if (parent.TYPO3LiveSearch.getRawValue() == '') {
+ parent.TYPO3LiveSearch.originalValue = parent.TYPO3LiveSearch.emptyText;
+ parent.TYPO3LiveSearch.reset(this);
+ }
+
+ if (parent.TYPO3LiveSearch.helpList.isVisible()) {
+ parent.TYPO3LiveSearch.helpList.remove();
+ }
+ }
+ };
+ this.hasIframeListeners = true;
+ }, this);
+