Add a page for toggling the cookie used for the new layout experiment
This commit is contained in:
		
							parent
							
								
									b66551ec48
								
							
						
					
					
						commit
						83d25d8c2b
					
				
					 4 changed files with 56 additions and 1 deletions
				
			
		
							
								
								
									
										19
									
								
								static/js/pages/exp-new-layout.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								static/js/pages/exp-new-layout.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| (function() { | ||||
|   /** | ||||
|    * Experiment enable page: New layout | ||||
|    */ | ||||
|   angular.module('quayPages').config(['pages', function(pages) { | ||||
|     pages.create('exp-new-layout', 'exp-new-layout.html', ExpCtrl, { | ||||
|       'newLayout': true | ||||
|     }); | ||||
|   }]); | ||||
| 
 | ||||
|   function ExpCtrl($scope, CookieService) { | ||||
|     $scope.isEnabled = CookieService.get('quay.exp-new-layout') == 'true'; | ||||
| 
 | ||||
|     $scope.setEnabled = function(value) { | ||||
|       $scope.isEnabled = value; | ||||
|       CookieService.putPermanent('quay.exp-new-layout', value.toString()); | ||||
|     }; | ||||
|   } | ||||
| }()) | ||||
		Reference in a new issue