mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-11 12:44:22 +08:00
Update route filters on poem (de)activation
This commit is contained in:
@@ -3,8 +3,8 @@ angular.module("sideBySide.controllers", [])
|
||||
() -> null
|
||||
]
|
||||
.controller "ComparisonController", [
|
||||
'$document', '$rootScope', '$scope', 'load', 'poems', 'route', 'transformer'
|
||||
($document, $rootScope, $scope, load, poems, route, transformer) ->
|
||||
'$document', '$rootScope', '$scope', 'filter', 'load', 'poems', 'route', 'transformer'
|
||||
($document, $rootScope, $scope, filter, load, poems, route, transformer) ->
|
||||
min = 1
|
||||
max = 5
|
||||
|
||||
@@ -42,6 +42,7 @@ angular.module("sideBySide.controllers", [])
|
||||
active = poem.meta.Active
|
||||
if ((length > min or not active) and (length < max or active))
|
||||
poem.meta.Active = not poem.meta.Active
|
||||
route.update('display', filter.getFilter())
|
||||
# TODO else notification
|
||||
|
||||
$scope.flipPick = () ->
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
angular.module("sideBySide").factory "load", ['fetch', 'poems', (fetch, poems) ->
|
||||
angular.module("sideBySide").factory "load", ['filter', 'fetch', 'poems', (filter, fetch, poems) ->
|
||||
# Load poems
|
||||
#
|
||||
# @param base [String] Path to config file directory
|
||||
@@ -22,4 +22,5 @@ angular.module("sideBySide").factory "load", ['fetch', 'poems', (fetch, poems) -
|
||||
disp = display or config.data.display
|
||||
poems.all = (activize(poem, disp) for poem in poemList)
|
||||
poems.heading = config.data.heading
|
||||
filter.update()
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user