File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- //probably should put this in a local function on prod... fine for now tho
2-
3- if ( ! String . prototype . startsWith ) { // sweet polyfill
4- String . prototype . startsWith = function ( searchString , position ) {
5- position = position || 0 ;
6- return this . indexOf ( searchString , position ) === position ;
7- } ;
8- }
9-
101function blockToCSS ( blockList ) {
112 function blockToCSS_ ( block ) {
123 if ( block . name == 'selector' ) {
@@ -82,8 +73,16 @@ function setFrameContent(ext) {
8273 blocksToJSON ( currentFile ) ;
8374
8475 var previewWindow = previewElement ;
85- previewWindow = ( previewWindow . contentWindow ) ? previewWindow . contentWindow : ( previewWindow . contentDocument . document ) ? previewWindow . contentDocument . document : previewWindow . contentDocument ;
86- while ( previewWindow . document . firstChild ) previewWindow . document . removeChild ( previewWindow . document . firstChild ) ;
76+ if ( previewElement . contentWindow ) {
77+ previewWindow = previewWindow . contentWindow ;
78+ } else if ( previewElement . contentDocument . document ) {
79+ previewWindow = previewElement . contentDocument . document ;
80+ } else {
81+ previewWindow = previewWindow . contentDocument
82+ }
83+ var previewDocument = previewWindow . document ,
84+ child ;
85+ while ( child = previewDocument . firstChild ) previewDocument . removeChild ( child ) ;
8786 previewWindow . document . appendChild ( parsedHtml ) ;
8887 } else {
8988 throw 'this should never be thrown though' ;
You can’t perform that action at this time.
0 commit comments