mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-11 12:44:22 +08:00
Add active meta property of poems
This commit is contained in:
@@ -9,7 +9,11 @@ angular.module("sideBySide").service "poems", ['$rootScope', '$q', 'fetch', ($ro
|
||||
else
|
||||
fetch(config).then((result) ->
|
||||
$q.all(result.promises).then((results) ->
|
||||
poems = results
|
||||
for poem in results
|
||||
if not poem.meta.Active?
|
||||
poem.meta.Active = true
|
||||
poems.push poem
|
||||
|
||||
heading = result.heading
|
||||
loaded = true
|
||||
|
||||
@@ -18,10 +22,16 @@ angular.module("sideBySide").service "poems", ['$rootScope', '$q', 'fetch', ($ro
|
||||
)
|
||||
|
||||
@get = () ->
|
||||
poems
|
||||
poem for poem in poems when poem.meta.Active is true
|
||||
|
||||
@getHeading = () ->
|
||||
heading
|
||||
|
||||
@show = (id) ->
|
||||
poems[id].meta.Active = true
|
||||
|
||||
@hide = (id) ->
|
||||
poems[id].meta.Active = false
|
||||
|
||||
@
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user