Aleksander Machniak
2013-04-29 c958452d098be0cedf39e96a1ea29b1b5f265067
Catch possible "Permission denied" error on iframe elements in IE
2 files modified
18 ■■■■ changed files
skins/classic/functions.js 9 ●●●● patch | view | raw | blame | history
skins/larry/ui.js 9 ●●●● patch | view | raw | blame | history
skins/classic/functions.js
@@ -664,8 +664,13 @@
function iframe_events()
{
  // this==iframe
  var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null;
  rcube_event.add_listener({ element: doc, object:rcmail_ui, method:'body_mouseup', event:'mouseup' });
  try {
    var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null;
    rcube_event.add_listener({ element: doc, object:rcmail_ui, method:'body_mouseup', event:'mouseup' });
  }
  catch (e) {
    // catch possible "Permission denied" error in IE
  };
};
// Abbreviate mailbox names to fit width of the container
skins/larry/ui.js
@@ -251,8 +251,13 @@
    $('iframe').load(function(e){
      // this = iframe
      var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null;
      $(doc).mouseup(body_mouseup);
      try {
        var doc = this.contentDocument ? this.contentDocument : this.contentWindow ? this.contentWindow.document : null;
        $(doc).mouseup(body_mouseup);
      }
      catch (e) {
        // catch possible "Permission denied" error in IE
      };
    })
    .contents().mouseup(body_mouseup);