From ff21cb37e6363ebfb20ec41130cfc9f891cea1b5 Mon Sep 17 00:00:00 2001 From: shiawuen Date: Fri, 19 Jun 2015 12:12:37 +0800 Subject: [PATCH] fix bug on Browserify component when embed on another window replacing containing window content --- source/outro.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/outro.js b/source/outro.js index e99b9f6..20b91c2 100644 --- a/source/outro.js +++ b/source/outro.js @@ -1,14 +1,14 @@ /*jshint ignore:start */ -if ( top !== win ) { - win.editor = new Squire( doc ); - if ( win.onEditorLoad ) { - win.onEditorLoad( win.editor ); - win.onEditorLoad = null; - } +if ( typeof exports === 'object' ) { + module.exports = Squire; } else { - if ( typeof exports === 'object' ) { - module.exports = Squire; + if ( top !== win ) { + win.editor = new Squire( doc ); + if ( win.onEditorLoad ) { + win.onEditorLoad( win.editor ); + win.onEditorLoad = null; + } } else { win.Squire = Squire; }