From c22791610c341582be5e008bd0a72200ca385747 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sun, 18 Sep 2016 16:27:21 +0800 Subject: [PATCH] Fix scripts load order to prevent reference error, using query callback to prevent google api call before loaded --- public/js/index.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index d5678f568..dbedd66c5 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1242,6 +1242,8 @@ if (DROPBOX_APP_KEY) { .attr('src', 'https://www.dropbox.com/static/api/2/dropins.js') .attr('id', 'dropboxjs') .attr('data-app-key', DROPBOX_APP_KEY) + .prop('async', true) + .prop('defer', true) .appendTo('body'); } else { ui.toolbar.import.dropbox.hide(); @@ -1252,18 +1254,24 @@ if (DROPBOX_APP_KEY) { if (GOOGLE_API_KEY && GOOGLE_CLIENT_ID) { $('