mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-09 11:34:24 +08:00
Better config loading
This commit is contained in:
@@ -7,7 +7,15 @@ angular.module("sideBySide.controllers", [])
|
||||
then '/' + $previousRoute.params.base
|
||||
else ''
|
||||
|
||||
base = $location.url().replace(/\/(.*)\/.*/, '$1')
|
||||
appUrl = $location.absUrl()
|
||||
.substring(0, $location.absUrl().length - $location.url().length)
|
||||
.replace(/#$/, '')
|
||||
|
||||
base = appUrl + $location.url()
|
||||
.slice(1)
|
||||
.replace(/(.*)\/.*/, '$1')
|
||||
.replace(/\./g, '/')
|
||||
|
||||
poems.load base
|
||||
]
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ angular.module("sideBySide").service "poems", ['$q', 'fetch', ($q, fetch) ->
|
||||
(poem for poem in @all when poem.meta.Active is true)
|
||||
|
||||
@load = (base = '') =>
|
||||
config = base.replace(/\./g, '/') + "/config.json"
|
||||
config = base + "/config.json"
|
||||
|
||||
fetch(config).then (result) =>
|
||||
$q.all(result.promises).then (results) =>
|
||||
|
||||
Reference in New Issue
Block a user