Init the Angular app as soon as possible.

master
Nick Sergeant 2013-05-09 00:54:00 -04:00
parent 6d34639f15
commit 67f1fd41c3
2 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,3 @@
var snipt={module:function(){var modules={};return function(name){if(modules[name]){return modules[name];}
return modules[name]={};};}()};jQuery(function($){var SiteView=snipt.module('site').SiteView;window.site=new SiteView();});(function(){if(typeof angular!=='undefined'){var root=this;var app=angular.module('Snipt',[],function($locationProvider){$locationProvider.html5Mode(true);});app.config(function($interpolateProvider){$interpolateProvider.startSymbol('((');$interpolateProvider.endSymbol('))');});root.app=app;}}).call(this);
return modules[name]={};};}()};jQuery(function($){var SiteView=snipt.module('site').SiteView;window.site=new SiteView();});(function(){var root=this;var app=angular.module('Snipt',[],function($locationProvider){$locationProvider.html5Mode(true);});app.config(function($interpolateProvider){$interpolateProvider.startSymbol('((');$interpolateProvider.endSymbol('))');});root.app=app;}).call(this);

3
media/js/src/search.min.js vendored Normal file
View File

@ -0,0 +1,3 @@
(function(){if(typeof angular!=='undefined'){var root=this;var $=root.jQuery;var controllers={};var app=root.app;app.factory('SearchService',function(){return{mineOnly:false,query:''};});controllers.HeaderSearchController=function($scope,SearchService){$scope.search=SearchService;};controllers.SearchController=function($scope,SearchService){$scope.search=SearchService;$scope.$watch('search.query',function(query){if(query.indexOf('--mine')!==-1){$scope.search.mineOnly=true;}else{$scope.search.mineOnly=false;}});$scope.toggleMineOnly=function(){if($scope.search.mineOnly){if($scope.search.query.indexOf('--mine')===-1){$scope.search.query=$scope.search.query.trim()+' --mine';}}
else{$scope.search.query=$scope.search.query.replace('--mine','').trim();}};};app.controller(controllers);}}).call(this);