Author Topic: Using RC inside iframe leads to errors  (Read 5143 times)

Offline FatherCarbon

  • Newbie
  • *
  • Posts: 1
Using RC inside iframe leads to errors
« on: September 26, 2009, 12:24:56 AM »
I'm trying to load Roundcube into an iframe, but when RC tries to perform actions on its own iframes (in program/js/list.js), I get this error:

Code: [Select]
$("#" + iframes[n].id) is null
var pos = $('#'+iframes[n].id).offset();

This is the part of list.js where it occurs:

Code: [Select]
// add listener for iframes
    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)
      {
        var list = this;
        [B]var pos = $('#'+iframes[n].id).offset();[/B]

        this.iframe_events[n] = function(e) { e._offset = pos; return list.drag_mouse_move(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:'drag_mouse_up'});
      }
    }

It's getting late and I'm so lost. There's nothing special to know about the parent page, it just has RC loaded in an iframe. I can login, then when it gets to the inbox, it gets these errors, and messages won't load, etc.

If anyone needs any more info, please let me know and I'll do my best to provide it. Thanks! :confused:

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Using RC inside iframe leads to errors
« Reply #1 on: September 26, 2009, 12:57:03 AM »
Please open a ticket @ Roundcube Webmail
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Regards,
Rosali
__________________
MyRoundcube Project (commercial)