mirror of
https://github.com/wassname/side-by-side.git
synced 2026-10-29 13:41:25 +08:00
Assemble correct display url part
This commit is contained in:
1 parent
6d039a8230
commit
9055e027df
3 files changed
+15
-4
No files matched your search
@@ -22,9 +22,16 @@ angular.module("sideBySide").service "route", ['$location', ($location) ->
|
||||
@appUrl = $location.absUrl()
|
||||
.substring(0, $location.absUrl().length - $location.url().length)
|
||||
|
||||
getValue = (value) ->
|
||||
if (typeof value == 'object')
|
||||
for key, val of value
|
||||
# only works for one key...
|
||||
return key + ":" + val.join(',')
|
||||
value
|
||||
|
||||
@update = (key, value) ->
|
||||
@params[key] = value
|
||||
$location.path (property + ':' + value for property, value of @params).join('/')
|
||||
$location.path (property + ':' + getValue(value) for property, value of @params).join('/')
|
||||
|
||||
@
|
||||
]
|
||||
Reference in new issue
Block a user