From 660a509b333f58264bd812ee49e79e55867738dc Mon Sep 17 00:00:00 2001 From: Wedge Date: Thu, 23 Jun 2016 04:49:36 +0300 Subject: [PATCH] Bugfixes --- .../angularjs/controllers/rosa_abf_controller.js | 15 +++++++++++---- app/views/platforms/products/_form.html.slim | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js index 140089dca..4a7bf126e 100644 --- a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js +++ b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js @@ -18,16 +18,23 @@ RosaABF.controller('RosaABFController', ['$scope', 'LocalesHelper', 'SoundNotifi toggle = false; } - if(typeof $cookies.get('toggle') == 'undefined') { - $scope.toggle = toggle; + if(toggle) { + if(typeof $cookies.get('toggle') == 'undefined') { + $scope.toggle = toggle; + } + else { + $scope.toggle = $cookies.get('toggle') == 'true' ? true : false; + } } else { - $scope.toggle = $cookies.get('toggle') == 'true' ? true : false; + $scope.toggle = false; } $scope.toggleSidebar = function() { $scope.toggle = !$scope.toggle; - $cookies.put("toggle", $scope.toggle); + if(toggle) { + $cookies.put("toggle", $scope.toggle); + } }; }]); diff --git a/app/views/platforms/products/_form.html.slim b/app/views/platforms/products/_form.html.slim index 62d0341ac..7183e9ad7 100644 --- a/app/views/platforms/products/_form.html.slim +++ b/app/views/platforms/products/_form.html.slim @@ -1,7 +1,7 @@ = f.input :name = f.input :description, as: :text -div ng-controller="ProjectsVersionsTypeaheadController" ng-init=('init("'+@platform.name+'","'+@product.project.try(:name_with_owner).to_s+'","'+@product.project_id.to_s+'","'+@product.project_version+'")') +div ng-controller="ProjectsVersionsTypeaheadController" ng-init=('init("'+@platform.name+'","'+@product.project.try(:name_with_owner).to_s+'","'+@product.project_id.to_s+'","'+@product.project_version.to_s+'")') = f.input :project_id, as: :string, input_html: { uib_typeahead: 'project.name for project in getProjects($viewValue)', typeahead_wait_ms: 200,