Source: IFrame.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
 * A dock
 * @param {Object} The options
 * @constructor
 */
hui.ui.IFrame = function(options) {
  this.options = options;
  this.element = hui.get(options.element);
  this.name = options.name;
  hui.ui.extend(this);
};

hui.ui.IFrame.prototype = {
  /** Change the url of the iframe
   * @param {String} url The url to change the iframe to
   */
  setUrl : function(url) {
    this.element.setAttribute('src',url);
    //hui.frame.getDocument(this.element).location.href=url;
  },
  clear : function() {
    this.setUrl('about:blank');
  },
  getDocument : function() {
    return hui.frame.getDocument(this.element);
  },
  getWindow : function() {
    return hui.frame.getWindow(this.element);
  },
  reload : function() {
    this.getWindow().location.reload();
  },
  show : function() {
    this.element.style.display='';
  },
  hide : function() {
    this.element.style.display='none';
  }
};