diff options
author | Caio Carrara <ccarrara@thoughtworks.com> | 2016-03-31 12:41:58 -0300 |
---|---|---|
committer | Caio Carrara <ccarrara@thoughtworks.com> | 2016-03-31 12:41:58 -0300 |
commit | d75a8878d20117bc595f80a2ea2a68f84f48f508 (patch) | |
tree | 0893d141d4f97fe5fbf6daa02ae1ce5972ae8d72 /web-ui | |
parent | 43377bd550183a404d387d297d6f610697388114 (diff) |
Issue #622: improve messages dealing on sandbox
Diffstat (limited to 'web-ui')
-rw-r--r-- | web-ui/app/js/sandbox.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/web-ui/app/js/sandbox.js b/web-ui/app/js/sandbox.js index 63ce94b2..33b16ea4 100644 --- a/web-ui/app/js/sandbox.js +++ b/web-ui/app/js/sandbox.js @@ -1,14 +1,11 @@ (function () { 'use strict'; - window.addEventListener('message', function(e) { - var mainWindow = e.source; - mainWindow.postMessage('data ok', e.origin); - }); - window.onmessage = function (e) { if (e.data.html) { document.body.innerHTML = e.data.html; + var mainWindow = e.source; + mainWindow.postMessage('data ok', e.origin); } }; })(); |