@@ -160,7 +160,7 @@ return /******/ (function(modules) { // webpackBootstrap
160
160
} , {
161
161
key : '_vars' ,
162
162
value : function _vars ( ) {
163
- this . revision = '1.4.5 ' ;
163
+ this . revision = '1.4.6 ' ;
164
164
this . store = ( 0 , _store2 . default ) ( ) ;
165
165
166
166
this . _easings = [ ] ;
@@ -177,34 +177,47 @@ return /******/ (function(modules) { // webpackBootstrap
177
177
value : function _render ( ) {
178
178
var _this = this ;
179
179
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 ( ) ;
189
188
} ) ;
190
189
}
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
+ }
191
204
} , {
192
205
key : '_listenUnload' ,
193
206
value : function _listenUnload ( ) {
194
- var _this2 = this ;
207
+ var _this3 = this ;
195
208
196
209
var unloadEvent = 'onpagehide' in window ? 'pagehide' : 'beforeunload' ;
197
210
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 ( ) ) ;
200
213
201
214
delete preState . points . history ;
202
215
delete preState . pointControls . history ;
203
216
preState . progressLines . lines = [ ] ;
204
217
205
- localStorage . setItem ( _this2 . _localStorage , ( 0 , _stringify2 . default ) ( preState ) ) ;
218
+ localStorage . setItem ( _this3 . _localStorage , ( 0 , _stringify2 . default ) ( preState ) ) ;
206
219
} else {
207
- localStorage . removeItem ( _this2 . _localStorage ) ;
220
+ localStorage . removeItem ( _this3 . _localStorage ) ;
208
221
}
209
222
} ) ;
210
223
}
@@ -236,7 +249,7 @@ return /******/ (function(modules) { // webpackBootstrap
236
249
} , {
237
250
key : '_compilePath' ,
238
251
value : function _compilePath ( ) {
239
- var _this3 = this ;
252
+ var _this4 = this ;
240
253
241
254
var state = this . store . getState ( ) ;
242
255
var points = state . points . present ;
@@ -249,10 +262,10 @@ return /******/ (function(modules) { // webpackBootstrap
249
262
250
263
clearTimeout ( this . _tm ) ;
251
264
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 ) ;
256
269
}
257
270
} , 40 ) ;
258
271
}
@@ -302,25 +315,25 @@ return /******/ (function(modules) { // webpackBootstrap
302
315
} , {
303
316
key : 'getEasing' ,
304
317
value : function getEasing ( ) {
305
- var _this4 = this ;
318
+ var _this5 = this ;
306
319
307
320
var o = arguments . length <= 0 || arguments [ 0 ] === undefined ? { } : arguments [ 0 ] ;
308
321
309
322
// get the easing function regarding reverse options
310
323
var fun = function ( ) {
311
- var i = _this4 . _easings . length ;
324
+ var i = _this5 . _easings . length ;
312
325
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 ) ;
316
329
} ;
317
330
} ( ) ;
318
331
319
332
this . store . dispatch ( { type : 'ADD_PROGRESS_LINE' , data : { } } ) ;
320
333
this . _easings . push ( { options : o , easing : fun } ) ;
321
334
322
335
( 0 , _defer2 . default ) ( function ( ) {
323
- _this4 . _fireOnChange ( _this4 . _prevPath ) ;
336
+ _this5 . _fireOnChange ( _this5 . _prevPath ) ;
324
337
} ) ;
325
338
return fun ;
326
339
}
0 commit comments