Move CSS to multiline string.
This commit is contained in:
parent
32b3253e08
commit
681a9e2e5b
@ -1,6 +1,9 @@
|
|||||||
Captcha.fixes =
|
Captcha.fixes =
|
||||||
selectors:
|
css: '''
|
||||||
image: '.rc-imageselect-target > .rc-imageselect-tile > img'
|
.rc-imageselect-target > .rc-imageselect-tile > img:focus {
|
||||||
|
outline: 2px solid #4a90e2;
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
switch location.pathname.split('/')[3]
|
switch location.pathname.split('/')[3]
|
||||||
@ -17,13 +20,13 @@ Captcha.fixes =
|
|||||||
$.queueTask focus
|
$.queueTask focus
|
||||||
|
|
||||||
initPopup: ->
|
initPopup: ->
|
||||||
$.addStyle "#{@selectors.image}:focus {outline: 2px solid #4a90e2;}"
|
$.addStyle @css
|
||||||
@fixImages()
|
@fixImages()
|
||||||
new MutationObserver(=> @fixImages()).observe d.body, {childList: true, subtree: true}
|
new MutationObserver(=> @fixImages()).observe d.body, {childList: true, subtree: true}
|
||||||
$.on d, 'keydown', @keybinds.bind(@)
|
$.on d, 'keydown', @keybinds.bind(@)
|
||||||
|
|
||||||
fixImages: ->
|
fixImages: ->
|
||||||
return unless (@images = $$ @selectors.image).length
|
return unless (@images = $$ '.rc-imageselect-target > .rc-imageselect-tile > img').length
|
||||||
focus = @images[0].tabIndex isnt 0
|
focus = @images[0].tabIndex isnt 0
|
||||||
for img in @images
|
for img in @images
|
||||||
img.tabIndex = 0
|
img.tabIndex = 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user