Changeset 572

add iframeshom on modal window for IE

Apr 15 2008 * 15:23 (7 months ago)
Committed by seb

Affected files:

trunk/src/util/iframe_shim.js (Unified diff)

r570r572
2626
2727 UI.IframeShim = Class.create(UI.Options, {
2828
29 options: {
30 parent: document.body
31 },
32
2933 /*
3034 Method: initialize
3135 Constructor
------
3741 Returns:
3842 this
3943 */
40 initialize: function() {
44 initialize: function(options) {
45 this.setOptions(options);
4146 this.element = new Element('iframe', {
4247 style: 'position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=1);',
4348 src: 'javascript:false;',
4449 frameborder: 0
4550 });
46 $(document.body).insert(this.element);
51 $(this.options.parent || document.body).insert(this.element);
4752 },
4853
4954 /*
------
104109 */
105110 setBounds: function(bounds) {
106111 for (prop in bounds) {
107 bounds[prop] += 'px';
112 bounds[prop] = parseInt(bounds[prop]) + 'px';
108113 }
109114 this.element.setStyle(bounds);
110115 return this;

trunk/src/window/shadow.js (Unified diff)

r570r572
4848
4949 if (this.options.shadow)
5050 this.shadow = new UI.Shadow(this.element, {theme: this.getShadowTheme(), withIFrameShim: false});
51 this.iframe = Prototype.Browser.IE ? new UI.IframeShim() : null;
51 this.iframe = Prototype.Browser.IE || true ? new UI.IframeShim({parent: this.windowManager.container}) : null;
5252 },
5353
5454 addElementsWithShadow: function() {

trunk/src/window/window_manager.js (Unified diff)

r515r572
149149 this.modalOverlay.setStyle("height: " + this.viewport.getHeight() + "px");
150150
151151 this.options.showOverlay(this.modalOverlay, {from: 0, to: this.modalOverlay.opacity});
152 if (this.iframe) {
153 this.iframe.setBounds({top: 0, left: 0, width: this.viewport.getWidth(), height: this.viewport.getHeight()});
154 this.iframe.show();
155 }
152156 }
153157 this.modalOverlay.setStyle({ zIndex: win.zIndex - 1 });
154158 this.modalSessions++;
------
161165 } else {
162166 this.resetOverflow();
163167 this.options.hideOverlay(this.modalOverlay, { from: this.modalOverlay.opacity, to: 0 });
168 if (this.iframe)
169 this.iframe.hide();
164170 }
165171 },
166172
------
267273 createOverlays: function() {
268274 this.modalOverlay = new Element("div", { style: this.overlayStyle });
269275 this.dragOverlay = new Element("div", { style: this.overlayStyle+"height: 100%" });
276 this.iframe = Prototype.Browser.IE ? new UI.IframeShim() : null;
270277 },
271278
272279 focus: function(win) {

trunk/test/functional/window/test_modal.html (Unified diff)

r516r572
2424 <div id="link2"><a href="#" onclick="openModalInDesktop(); return false;">Open modal window in
desktop</a></div><br>
2525 <div id="desktop" style="position: absolute; top: 10px; right: 10px; border: 1px solid black; width: 600px; height: 400px;
overflow: auto">
2626 </div>
27 Add Select box for testing iFrameShim on IE<br/>
28 <select>
29 <option>option 1</option>
30 <option>option 2</option>
31 <option>option 3</option>
32 </select>
33 <br/>
34 <select>
35 <option>option 1</option>
36 <option>option 2</option>
37 <option>option 3</option>
38 </select>
2739 <script type="text/javascript">
2840 //insertDebugControl();
2941 function runTest() {
------
3446 }
3547 document.whenReady(runTest);
3648
37 var top = 10, left = 10;
49 var pos = {top: 10, left: 10};
3850
3951 function openModal() {
40 w = new UI.Window({shadow: true, top: top, left: left});
41 top += 20;
42 left += 20;
52 w = new UI.Window({shadow: true, top: pos.top, left: pos.left});
53 pos.top += 20;
54 pos.left += 20;
4355 w.setContent($('link').innerHTML);
4456 w.show(true).focus();
45 w.observe("hidden", function() {top -= 20; left -= 20})
57 w.observe("hidden", function() {pos.top -= 20; pos.left -= 20})
4658 }
4759
4860 function openModalInDesktop() {
49 w = new UI.Window({shadow: true, top: top, left: left, windowManager: wm});
50 top += 20;
51 left += 20;
61 w = new UI.Window({shadow: true, top: pos.top, left: pos.left, windowManager: wm});
62 pos.top += 20;
63 pos.left += 20;
5264 w.setContent($('link2').innerHTML);
5365 w.show(true).focus();
54 w.observe("hidden", function() {top -= 20; left -= 20})
66 w.observe("hidden", function() {pos.top -= 20; pos.left -= 20})
5567 }
5668
5769 </script>