Prevent posible race condition on navurls
parent
f9bf250b38
commit
3f7776a01d
|
@ -105,21 +105,21 @@ NavigationUrlsDirective = ($navurls, $auth, $q, $location) ->
|
||||||
if target.is("a")
|
if target.is("a")
|
||||||
target.attr("href", fullUrl)
|
target.attr("href", fullUrl)
|
||||||
|
|
||||||
$el.on "click", (event) ->
|
$el.on "click", (event) ->
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
target = $(event.currentTarget)
|
target = $(event.currentTarget)
|
||||||
|
|
||||||
if target.hasClass('noclick')
|
if target.hasClass('noclick')
|
||||||
return
|
return
|
||||||
|
|
||||||
fullUrl = target.data("fullUrl")
|
fullUrl = target.data("fullUrl")
|
||||||
|
|
||||||
switch event.which
|
switch event.which
|
||||||
when 1
|
when 1
|
||||||
$location.url(fullUrl)
|
$location.url(fullUrl)
|
||||||
$scope.$apply()
|
$scope.$apply()
|
||||||
when 2
|
when 2
|
||||||
window.open fullUrl
|
window.open fullUrl
|
||||||
|
|
||||||
$scope.$on "$destroy", ->
|
$scope.$on "$destroy", ->
|
||||||
$el.off()
|
$el.off()
|
||||||
|
|
Loading…
Reference in New Issue