Simplify PagesetCtrl

This commit is contained in:
Maikel Linke
2020-03-11 10:56:21 +11:00
parent a21ef19529
commit 4b8d9d18d7

View File

@@ -1,10 +1,6 @@
Darkswarm.controller "PagesetCtrl", ($scope, $location) ->
$scope.selected = ->
path = $location.path()?.match(/^\/\w+$/)?[0]
if path
path[1..]
else
$scope.defaultPage
$location.path()[1..] || $scope.defaultPage
$scope.selectDefault = (selection) ->
$scope.defaultPage = selection