Customizable headings

This commit is contained in:
Vit Brunner
2014-06-12 22:22:40 +02:00
parent 3d57d26d9b
commit 04a0c96c80
2 changed files with 11 additions and 4 deletions
@@ -9,15 +9,18 @@ angular.module("sideBySide.controllers", [])
}]]
update = (config) ->
fetch(config).then((promises) ->
$q.all(promises).then((results) ->
fetch(config).then((result) ->
$q.all(result.promises).then((results) ->
$scope.columns = results.length
transformed = transformer(results)
$scope.verses = transformed.verses
$scope.meta = transformed.meta
headingKey = result.heading or "Author"
$scope.headings = (version[headingKey] for version in transformed.meta)
)
)
update($location.path() + "/config.json")
update(window.location.pathname.slice(0, -1) + $location.path() + "/config.json")
]
#.controller "notificationController", ['$scope', '$timeout', ($scope, $timeout) ->
@@ -11,6 +11,10 @@ angular.module("sideBySide").factory "fetch", ['$http', 'readerFactory', ($http,
reader = readerFactory(poem)
return reader(response.data)
))
return promises
return {
promises: promises
heading: response.data.heading
}
)
]