@@ -160,7 +160,7 @@ return /******/ (function(modules) { // webpackBootstrap
160160 } , {
161161 key : '_vars' ,
162162 value : function _vars ( ) {
163- this . revision = '1.4.5 ' ;
163+ this . revision = '1.4.6 ' ;
164164 this . store = ( 0 , _store2 . default ) ( ) ;
165165
166166 this . _easings = [ ] ;
@@ -177,34 +177,47 @@ return /******/ (function(modules) { // webpackBootstrap
177177 value : function _render ( ) {
178178 var _this = this ;
179179
180- document . addEventListener ( 'DOMContentLoaded' , function ( ) {
181- ( 0 , _preact . render ) ( ( 0 , _preact . h ) (
182- _preactRedux . Provider ,
183- { store : _this . store } ,
184- ( 0 , _preact . h ) ( _curveEditor2 . default , { progressLines : _this . _progressLines ,
185- ref : function ref ( el ) {
186- _this . _el = el ;
187- } } )
188- ) , document . body ) ;
180+ var doc = document ;
181+ var docState = doc . readyState ;
182+ if ( docState === "complete" || docState === "loaded" || docState === "interactive" ) {
183+ return this . _renderApp ( ) ;
184+ }
185+
186+ doc . addEventListener ( 'DOMContentLoaded' , function ( ) {
187+ _this . _renderApp ( ) ;
189188 } ) ;
190189 }
190+ } , {
191+ key : '_renderApp' ,
192+ value : function _renderApp ( ) {
193+ var _this2 = this ;
194+
195+ ( 0 , _preact . render ) ( ( 0 , _preact . h ) (
196+ _preactRedux . Provider ,
197+ { store : this . store } ,
198+ ( 0 , _preact . h ) ( _curveEditor2 . default , { progressLines : this . _progressLines ,
199+ ref : function ref ( el ) {
200+ _this2 . _el = el ;
201+ } } )
202+ ) , document . body ) ;
203+ }
191204 } , {
192205 key : '_listenUnload' ,
193206 value : function _listenUnload ( ) {
194- var _this2 = this ;
207+ var _this3 = this ;
195208
196209 var unloadEvent = 'onpagehide' in window ? 'pagehide' : 'beforeunload' ;
197210 window . addEventListener ( unloadEvent , function ( ) {
198- if ( _this2 . _props . isSaveState ) {
199- var preState = ( 0 , _extends3 . default ) ( { } , _this2 . store . getState ( ) ) ;
211+ if ( _this3 . _props . isSaveState ) {
212+ var preState = ( 0 , _extends3 . default ) ( { } , _this3 . store . getState ( ) ) ;
200213
201214 delete preState . points . history ;
202215 delete preState . pointControls . history ;
203216 preState . progressLines . lines = [ ] ;
204217
205- localStorage . setItem ( _this2 . _localStorage , ( 0 , _stringify2 . default ) ( preState ) ) ;
218+ localStorage . setItem ( _this3 . _localStorage , ( 0 , _stringify2 . default ) ( preState ) ) ;
206219 } else {
207- localStorage . removeItem ( _this2 . _localStorage ) ;
220+ localStorage . removeItem ( _this3 . _localStorage ) ;
208221 }
209222 } ) ;
210223 }
@@ -236,7 +249,7 @@ return /******/ (function(modules) { // webpackBootstrap
236249 } , {
237250 key : '_compilePath' ,
238251 value : function _compilePath ( ) {
239- var _this3 = this ;
252+ var _this4 = this ;
240253
241254 var state = this . store . getState ( ) ;
242255 var points = state . points . present ;
@@ -249,10 +262,10 @@ return /******/ (function(modules) { // webpackBootstrap
249262
250263 clearTimeout ( this . _tm ) ;
251264 this . _tm = setTimeout ( function ( ) {
252- if ( _this3 . _prevPath !== path ) {
253- _this3 . _prevPath = path ;
254- _this3 . _easing = mojs . easing . path ( path ) ;
255- _this3 . _fireOnChange ( path ) ;
265+ if ( _this4 . _prevPath !== path ) {
266+ _this4 . _prevPath = path ;
267+ _this4 . _easing = mojs . easing . path ( path ) ;
268+ _this4 . _fireOnChange ( path ) ;
256269 }
257270 } , 40 ) ;
258271 }
@@ -302,25 +315,25 @@ return /******/ (function(modules) { // webpackBootstrap
302315 } , {
303316 key : 'getEasing' ,
304317 value : function getEasing ( ) {
305- var _this4 = this ;
318+ var _this5 = this ;
306319
307320 var o = arguments . length <= 0 || arguments [ 0 ] === undefined ? { } : arguments [ 0 ] ;
308321
309322 // get the easing function regarding reverse options
310323 var fun = function ( ) {
311- var i = _this4 . _easings . length ;
324+ var i = _this5 . _easings . length ;
312325 return function ( k ) {
313- _this4 . _updateProgressLine ( k , i , _this4 . _progressLines ) ;
314- var transform = _this4 . _easings [ i ] . options . transform ;
315- return transform ? transform ( _this4 . _easing ( k ) ) : _this4 . _easing ( k ) ;
326+ _this5 . _updateProgressLine ( k , i , _this5 . _progressLines ) ;
327+ var transform = _this5 . _easings [ i ] . options . transform ;
328+ return transform ? transform ( _this5 . _easing ( k ) ) : _this5 . _easing ( k ) ;
316329 } ;
317330 } ( ) ;
318331
319332 this . store . dispatch ( { type : 'ADD_PROGRESS_LINE' , data : { } } ) ;
320333 this . _easings . push ( { options : o , easing : fun } ) ;
321334
322335 ( 0 , _defer2 . default ) ( function ( ) {
323- _this4 . _fireOnChange ( _this4 . _prevPath ) ;
336+ _this5 . _fireOnChange ( _this5 . _prevPath ) ;
324337 } ) ;
325338 return fun ;
326339 }
0 commit comments