Check originalEvent.repeat *and* event.repeat
phantomjs < 2.0 doesn't support creating `KeyboardEvent` so the tests were failing on CI
This commit is contained in:
parent
fcf99d0d09
commit
dbf9ccbcfe
|
@ -14,7 +14,7 @@
|
|||
# </form>
|
||||
#
|
||||
$(document).on 'keydown.quick_submit', '.js-quick-submit', (e) ->
|
||||
return if e.originalEvent.repeat
|
||||
return if (e.originalEvent && e.originalEvent.repeat) || e.repeat
|
||||
return unless e.keyCode == 13 # Enter
|
||||
|
||||
if navigator.userAgent.match(/Macintosh/)
|
||||
|
|
|
@ -67,7 +67,4 @@ describe 'Quick Submit behavior', ->
|
|||
else
|
||||
defaults = { keyCode: 13, ctrlKey: true }
|
||||
|
||||
args = $.extend({}, defaults, options)
|
||||
originalEvent = new KeyboardEvent('keydown', args)
|
||||
|
||||
$.Event('keydown', $.extend({}, args, {originalEvent: originalEvent}))
|
||||
$.Event('keydown', $.extend({}, defaults, options))
|
||||
|
|
Loading…
Reference in New Issue