- // need to listen in any iframe documents too, b/c otherwise the splitter stops moving when we move over an iframe
- var iframes = document.getElementsByTagName('iframe');
- this.iframe_events = Object();
- for (var n in iframes)
- {
- var iframedoc = null;
- if (iframes[n].contentDocument)
- iframedoc = iframes[n].contentDocument;
- else if (iframes[n].contentWindow)
- iframedoc = iframes[n].contentWindow.document;
- else if (iframes[n].document)
- iframedoc = iframes[n].document;
- if (iframedoc)
- {
- // I don't use the add_listener function for this one because I need to create closures to fetch
- // the position of each iframe when the event is received
- var s = this;
- var id = '#'+iframes[n].id;
- this.iframe_events[n] = function(e){ e._offset = $(id).offset(); return s.onDrag(e); }
-
- if (iframedoc.addEventListener)
- iframedoc.addEventListener('mousemove', this.iframe_events[n], false);
- else if (iframes[n].attachEvent)
- iframedoc.attachEvent('onmousemove', this.iframe_events[n]);
- else
- iframedoc['onmousemove'] = this.iframe_events[n];
-
- rcube_event.add_listener({element:iframedoc, event:'mouseup', object:this, method:'onDragStop'});
- }
- }
- }
+ // enable dragging above iframes
+ $('iframe').each(function() {
+ $('<div class="iframe-splitter-fix"></div>')
+ .css({background: '#fff',
+ width: this.offsetWidth+'px', height: this.offsetHeight+'px',
+ position: 'absolute', opacity: '0.001', zIndex: 1000
+ })
+ .css($(this).offset())
+ .appendTo('body');
+ });
+ };