From b03970ea1d5ee534bb9c63e23cb7d25a43055efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szekeres=20Ba=CC=81lint?= Date: Fri, 26 Oct 2018 20:29:55 +0200 Subject: [PATCH] fix true handling from query --- public/assets/js/app.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/assets/js/app.js b/public/assets/js/app.js index 7739983..70f9d1b 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -202,10 +202,16 @@ var hashData = $location.search(); for (var key in hashData) { + // handle false if (hashData[key] === 'false') { hashData[key] = false; } + // handle true + if ((hashData[key] === 'true' || hashData[key] === '') && typeof $scope.data[key] === 'boolean') { + hashData[key] = true; + } + if ($scope.data[key] !== undefined && typeof $scope.data[key] === typeof hashData[key]) { $scope.isDirty = true; $scope.data[key] = hashData[key];