Add timeout for ajax call in award emoji steps; update focus in award picker
This commit is contained in:
parent
074fa8f2b9
commit
b80df08735
|
@ -5,7 +5,6 @@ class @AwardsHandler
|
|||
event.preventDefault()
|
||||
|
||||
@showEmojiMenu()
|
||||
$("#emoji_search").focus()
|
||||
|
||||
$("html").on 'click', (event) ->
|
||||
if !$(event.target).closest(".emoji-menu").length
|
||||
|
@ -18,10 +17,12 @@ class @AwardsHandler
|
|||
showEmojiMenu: ->
|
||||
if $(".emoji-menu").length
|
||||
$(".emoji-menu").show()
|
||||
$("#emoji_search").focus()
|
||||
else
|
||||
$.get "/emoji_menu", (response) ->
|
||||
$(".add-award").after response
|
||||
$(".emoji-menu").show()
|
||||
$("#emoji_search").focus()
|
||||
|
||||
addAward: (emoji) ->
|
||||
emoji = @normilizeEmojiName(emoji)
|
||||
|
|
|
@ -96,6 +96,7 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
step 'The search field is focused' do
|
||||
sleep 0.8
|
||||
page.evaluate_script("document.activeElement.id").should eq "emoji_search"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue