diff --git a/js/activate.js b/js/activate.js index 167757eb5..aa57ba94b 100644 --- a/js/activate.js +++ b/js/activate.js @@ -1,3 +1,5 @@ $(document).ready(function() { - OCA.FirstRunWizard.Wizard.showFirstRunWizard(); + OCP.Loader.loadScript('firstrunwizard', 'jquery.colorbox.js').then(function() { + OCA.FirstRunWizard.Wizard.showFirstRunWizard(); + }); }); diff --git a/js/firstrunwizard.js b/js/firstrunwizard.js index 8acb6e1a0..fef30e8ba 100644 --- a/js/firstrunwizard.js +++ b/js/firstrunwizard.js @@ -123,6 +123,12 @@ showFirstRunWizard: function(){ var self = this; + if (typeof $.colorbox === 'undefined') { + setTimeout(function () { + self.showFirstRunWizard(); + }, 200) + return; + } $.colorbox({ opacity: 0.7, transition: 'elastic', @@ -148,11 +154,19 @@ $(document).ready(function() { OCA.FirstRunWizard.Wizard.showFirstRunWizard(); }); - $('#expanddiv li[data-id="firstrunwizard-about"] a').on('click', function () { - OCA.FirstRunWizard.Wizard.showFirstRunWizard(); - $(this).find('div').remove(); - $(this).find('img').show(); - OC.hideMenus(function(){return false;}); + $('#expanddiv li[data-id="firstrunwizard-about"] a').on('click', function (e) { + var target = $(e.target); + target.prepend($('
').addClass('icon-loading-small')); + target.find('img').hide(); + OCP.Loader.loadScript('firstrunwizard', 'jquery.colorbox.js').then(function() { + target.find('icon-loading-small').remove(); + OCA.FirstRunWizard.Wizard.showFirstRunWizard(); + target.find('div').remove(); + target.find('img').show(); + OC.hideMenus(function () { + return false; + }); + }); return false; }); }); diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 2e1a6db9a..6f18c1227 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -53,7 +53,6 @@ public function register() { protected function registerScripts() { /* Always load scripts and styles since we need those for the about menu */ \OC_Util::addStyle('firstrunwizard', 'firstrunwizard'); - \OC_Util::addScript('firstrunwizard', 'jquery.colorbox'); \OC_Util::addScript('firstrunwizard', 'firstrunwizard'); /** @var EventDispatcherInterface $dispatcher */