mirror of
https://github.com/wassname/side-by-side.git
synced 2026-08-22 12:30:36 +08:00
31 lines
688 B
CoffeeScript
31 lines
688 B
CoffeeScript
angular.module("sideBySide").controller "AppController",
|
|
['$scope', 'ngDialog', 'filter', 'poems'
|
|
($scope, ngDialog, filter, poems) ->
|
|
$scope.title = =>
|
|
poems.config.title || 'Side By Side viewer'
|
|
|
|
$scope.description = =>
|
|
poems.config.description || ''
|
|
|
|
$scope.$watchCollection ->
|
|
poems.config
|
|
, ->
|
|
if 'links' of poems.config
|
|
$scope.links = poems.config.links.map (link) ->
|
|
link.display = JSON.stringify link.display
|
|
link
|
|
|
|
$scope.display = (encoded) ->
|
|
filter.setFilter JSON.parse encoded
|
|
|
|
$scope.showPage = (page) ->
|
|
ngDialog.open {
|
|
template: 'partials/' + page + '.html'
|
|
}
|
|
|
|
$scope.flipPick = ->
|
|
$scope.pick = not $scope.pick
|
|
|
|
$scope.pick = false
|
|
]
|