ff-stream-web

git clone git://archive.git.mtrnord.blog/MTRNord/ff-stream-web.git
Log | Files | Refs | README | LICENSE

commit 9659167f47b2d7769b8878137c9b0ced33655efb
parent 133f30b5e15f3ee6f574ed75ea440600f0862732
Author: Alexandur Seferinkyn <d0ntth1nc@gmail.com>
Date:   Tue, 16 Jun 2015 01:38:37 +0300

Removed unnecessary page load at client boot

Diffstat:
Msrc/app.js | 21+++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/src/app.js b/src/app.js @@ -25,6 +25,8 @@ let onSetMeta = (name, content) => { }; function run() { + FastClick.attach(document.body); + // Render the top-level React component let props = { path: path, @@ -48,15 +50,10 @@ function run() { }); } -// Run the application when both DOM is ready -// and page content is loaded -Promise.all([ - new Promise((resolve) => { - if (window.addEventListener) { - window.addEventListener('DOMContentLoaded', resolve); - } else { - window.attachEvent('onload', resolve); - } - }).then(() => FastClick.attach(document.body)), - new Promise((resolve) => AppActions.loadPage(path, resolve)) -]).then(run); +new Promise((resolve) => { + if (window.addEventListener) { + window.addEventListener('DOMContentLoaded', resolve); + } else { + window.attachEvent('onload', resolve); + } +}).then(run);