Remoto - VFS: iframe.js Source File
Remoto - VFS
iframe.js
Go to the documentation of this file.
1 
2 define( [
3  'remoto!stdlib:js/panes/pane.js',
4  'remoto!stdlib:js/panes/panes/iframe.css',
5  ],
6  function(pane)
7  {
8  'use strict';
9 
29  iframe.prototype = new pane;
30  function iframe(layout)
31  {
32  pane.call(this,layout);
33 
34  //console.log("create iframe!",layout);
35 
36  this._url = layout.url || null;
37  }
38 
48  iframe.prototype.createHTML = function()
49  {
50  if (this._html) return this._html;
51 
52  this._html = $("<iframe class='iframe'>");
53 
54  if (this._url)
55  this._html.attr("src",this._url);
56 
57  return this._html;
58  }
59 
70  iframe.prototype.applySubscription = function(data,metadata)
71  {
72  //console.log("iframe applySubscription!",arguments);
73 
74  if (this._subscribed)
75  return;
76 
77  this._subscribed = true;
78 
79  return this.applyDiff(data);
80  }
81 
92  iframe.prototype.applyDiff = function(diff,user)
93  {
94  //console.log("iframe applyDiff!",diff,user);
95 
96  if (diff.url)
97  { this._url = diff.url;
98  if (this._html)
99  this._html.attr("src",this._url);
100  }
101  }
102 
112  iframe.prototype.applySettings = function(settings)
113  {
114  //console.log("apply settings",settings);
115  }
116 
125  iframe.prototype.resize = function()
126  {
127  //console.log("iframe resize");
128 
129  if (this._html && this._html.parent())
130  { this._html.parent().css("overflow","hidden");
131  this._html.css("height",this._html.parent().height()+"px");
132  }
133  }
134 
135  return iframe;
136  }
137 );
setter user
a setter DOCME
Load an iframe into a pane.
iframe(layout)
applySettings(settings)
resize()
This is an inelegant solution to a baffling bug: for some reason the iframe does not dynamically resi...
applyDiff(diff, user)
createHTML()
applySubscription(data, metadata)
Create a pane which will be mounted into a paneManager layout.
pane(layout, object)
applyDiff(diff, user)
metadata(paths)