Aleksander Machniak
2013-04-29 fb2f066370d1ef30ff6d68ab3f20c17f861a5286
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
@@ -634,8 +634,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
@@ -244,8 +244,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);