Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit ee61dc0

Browse files
committed
make compatible with native imports: need to use postMessage instead of iframe on-load for inter-window comm.
1 parent 294ae75 commit ee61dc0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

elements/designer-element/designer-element.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<link rel="import" href="../x-dom-serializer/x-dom-serializer.html">
88

9-
<link rel="import" href="../x-inspector/x-inspector.html">
9+
<link rel="import" href="../x-inspector/x-inspector.html">
1010
<link rel="import" href="../x-file-document/x-file-document.html">
1111

1212
<polymer-element name="designer-element">
@@ -67,7 +67,7 @@
6767
<section name="design">
6868
<polymer-flex-layout></polymer-flex-layout>
6969
<div id="frameContainer" flex>
70-
<iframe id="frame" src="designer.html" on-load="{{designWindowLoaded}}"></iframe>
70+
<iframe id="frame" src="designer.html"></iframe>
7171
</div>
7272
<x-inspector id="inspector" on-delete-element="{{deleteElement}}" on-parent-element="{{selectParentElement}}" on-bind-property="{{applyPropertyBinding}}"></x-inspector>
7373
</section>
@@ -93,6 +93,7 @@
9393
ready: function() {
9494
document.addEventListener('keydown',
9595
this.KeydownAndPromptForUnload.bind(this, window));
96+
window.addEventListener('message', this.designWindowLoaded.bind(this));
9697
this.firstLoad = true;
9798
},
9899
designWindowLoaded: function() {
@@ -179,7 +180,6 @@
179180
this.reloadDesigner();
180181
},
181182
reloadDesigner: function() {
182-
//this.$.frame.onload = this.designWindowLoaded.bind(this);
183183
designWindow.location.reload();
184184
},
185185
fullscreenAction: function() {

elements/designer-element/designer.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
<!doctype html>
22
<html>
33
<head>
4-
54
<title>Polymer Designer</title>
65

76
<script src="../../components/platform-dev/platform.js"></script>
7+
<script>
8+
window.parent.postMessage('designer-loading', location.href);
9+
</script>
10+
811
<link rel="import" href="../x-designer/x-designer.html">
912

1013
<style>

0 commit comments

Comments
 (0)