VRFS-4721 - Links in lesson chat should not require you to log in when external browser shows
This commit is contained in:
parent
6e8e509108
commit
efe1ee5d7d
|
|
@ -52,13 +52,23 @@ SessionStore = @SessionStore
|
||||||
notationClicked: (music_notation, e) ->
|
notationClicked: (music_notation, e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
context.JK.popExternalLink("/api/music_notations/#{music_notation.id}?target=_blank")
|
rest.getMusicNotation(music_notation.id).done((response) =>
|
||||||
|
context.JK.popExternalLink(response.url)
|
||||||
|
)
|
||||||
|
.fail((jqXHR) =>
|
||||||
|
context.JK.Banner.showAlert('Unable to fetch URL for music notation. Error: ' + jqXHR.responseText)
|
||||||
|
)
|
||||||
|
|
||||||
audioClicked: (music_notation, e) ->
|
audioClicked: (music_notation, e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
context.JK.popExternalLink("/api/music_notations/#{music_notation.id}?target=_blank")
|
rest.getMusicNotation(music_notation.id).done((response) =>
|
||||||
|
context.JK.popExternalLink(response.url)
|
||||||
|
)
|
||||||
|
.fail((jqXHR) =>
|
||||||
|
context.JK.Banner.showAlert('Unable to fetch URL for audio. Error: ' + jqXHR.responseText)
|
||||||
|
)
|
||||||
|
|
||||||
recordingClicked: (recording, e) ->
|
recordingClicked: (recording, e) ->
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
context.JK.popExternalLink("/recordings/#{recording.id}")
|
context.JK.popExternalLink("/recordings/#{recording.id}")
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ class ApiMusicNotationsController < ApiController
|
||||||
if '_blank'==params[:target]
|
if '_blank'==params[:target]
|
||||||
redirect_to @music_notation.sign_url
|
redirect_to @music_notation.sign_url
|
||||||
else
|
else
|
||||||
render :text => @music_notation.sign_url
|
render :json => {url: @music_notation.sign_url}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue