@@ -2,6 +2,7 @@ import { Widget, router, complexViews } from '@discoveryjs/discovery/dist/lib.um
22import settingsPage from '../settings' ;
33import '@discoveryjs/discovery/dist/lib.css' ;
44import './index.css' ;
5+ import { WRAPPER_NODE } from '../../core/constants' ;
56
67/**
78 * Discovery initialization
@@ -10,7 +11,7 @@ import './index.css';
1011 */
1112function initDiscovery ( options ) {
1213 const { settings } = options ;
13- const discovery = new Widget ( options . wrapper ) ;
14+ const discovery = new Widget ( options . discoveryNode ) ;
1415
1516 discovery . apply ( router ) ;
1617 discovery . apply ( complexViews ) ;
@@ -138,17 +139,18 @@ function getSettings(cb) {
138139 document . body . style . height = '100%' ;
139140 document . body . style . border = 'none' ;
140141 document . body . style . webkitTextSizeAdjust = '100%' ;
142+ document . body . style [ 'background-color' ] = '#fff' ;
143+ document . body . classList . add ( WRAPPER_NODE ) ;
141144
142- const wrapper = document . createElement ( 'div' ) ;
143- wrapper . classList . add ( 'discovery' ) ;
145+ const discoveryNode = document . createElement ( 'div' ) ;
146+ discoveryNode . style . height = '100%' ;
147+ document . body . appendChild ( discoveryNode ) ;
144148
145- document . body . appendChild ( wrapper ) ;
146-
147- wrapper . style [ 'background-color' ] = '#fff' ;
149+ document . body . appendChild ( discoveryNode ) ;
148150
149151 getSettings ( settings => {
150152 initDiscovery ( {
151- wrapper ,
153+ discoveryNode ,
152154 raw,
153155 data : json ,
154156 settings
0 commit comments