src/widgets/Mediafragment.js
branchnew-model
changeset 906 4b6e154ae8de
parent 905 029a4efe9e24
child 910 b9f1bd52df9a
--- a/src/widgets/Mediafragment.js	Mon May 21 13:17:47 2012 +0200
+++ b/src/widgets/Mediafragment.js	Tue May 22 16:49:48 2012 +0200
@@ -5,8 +5,8 @@
     window.onhashchange = this.functionWrapper("goToHash");
     if (typeof window.addEventListener !== "undefined") {
         window.addEventListener('message', function(_msg) {
-            if (_msg.data.type === "hashchange") {
-                document.location.hash = _msg.data.hash;
+            if (/^#/.test(_msg.data)) {
+                document.location.hash = _msg.data;
             }
         })
     };
@@ -73,10 +73,7 @@
         var _hash = this.getLastHash();
         document.location.hash = _hash;
         if (window.parent !== window) {
-            window.parent.postMessage({
-                type: "hashchange",
-                hash: _hash
-            })
+            window.parent.postMessage(_hash,"*")
         }
         this.block();
     }