Commits

Michael Granger committed 4a8c414

Fix load-order issues in some browsers

  • Participants
  • Parent commits 814e465

Comments (0)

Files changed (1)

File app/js/app.js

 'use strict';
 
 $script([
-	'/js/vendor/jquery-2.0.3.js',
-	'/js/vendor/angular/angular.js',
-	'/js/vendor/holder.min.js',
-], 'libs');
+	'/js/vendor/jquery-2.0.3.js'
+], 'jquery');
 
-$script.ready( 'libs', function() {
+$script.ready( 'jquery', function() {
+	console.debug( "JQuery loaded. Loading angular." );
+	$script([
+		'/js/vendor/angular/angular.js'
+	], 'angular');
+});
+
+$script.ready( 'angular', function() {
+	console.debug( "Libs loaded. Loading application." );
 	$script([
 		'/js/vendor/angular/angular-animate.min.js',
 		'/js/vendor/angular/angular-resource.min.js',
 		'/js/vendor/angular/angular-sanitize.min.js',
 		'/js/vendor/angular/angular-route.min.js',
 		'/js/vendor/ui-bootstrap-0.6.0.js',
+	], 'angular-libs');
+});
+
+$script.ready( 'angular-libs', function() {
+	console.debug( "Angular libs loaded. Loading plugins." );
+	$script([
 		'/js/vendor/imagesloaded.pkgd.js',
 		'/js/vendor/masonry.pkgd.js',
 		'/js/vendor/angular/angular-masonry.js',
 		'/js/vendor/resumable.js',
+	], 'plugins' );
+});
+
+$script.ready( 'plugins', function() {
+	console.debug( "Libs loaded. Loading application." );
+	$script([
 		'/js/angelfish/upload.js',
 		'/js/angelfish/gallery.js',
 		'/js/angelfish/filters.js',
 		'/js/angelfish/services.js',
 		'/js/navmenu.js',
 	], 'angelfish' );
-})
+});
 
 $script.ready( 'angelfish', function() {