Move repeated code into $.modifiedClick.
This commit is contained in:
parent
167f4e97ba
commit
c2a2dafe7f
@ -297,7 +297,7 @@ Index =
|
||||
Index.pageLoad()
|
||||
|
||||
pageNav: (e) ->
|
||||
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
||||
return if $.modifiedClick e
|
||||
switch e.target.nodeName
|
||||
when 'BUTTON'
|
||||
e.target.blur()
|
||||
|
||||
@ -41,7 +41,7 @@ ImageExpand =
|
||||
|
||||
cb:
|
||||
toggle: (e) ->
|
||||
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
||||
return if $.modifiedClick e
|
||||
post = Get.postFromNode @
|
||||
{file} = post
|
||||
return if file.isExpanded and ImageCommon.onControls e
|
||||
|
||||
@ -29,7 +29,7 @@ ExpandThread =
|
||||
ExpandThread.setButton thread
|
||||
|
||||
cbToggle: (e) ->
|
||||
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
||||
return if $.modifiedClick e
|
||||
e.preventDefault()
|
||||
ExpandThread.toggle Get.threadFromNode @
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ QuoteInline =
|
||||
href: link.href
|
||||
|
||||
toggle: (e) ->
|
||||
return if e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
||||
return if $.modifiedClick e
|
||||
|
||||
{boardID, threadID, postID} = Get.postDataFromLink @
|
||||
return if Conf['Inline Cross-thread Quotes Only'] and g.VIEW is 'thread' and g.posts["#{boardID}.#{postID}"]?.nodes.root.offsetParent # exists and not hidden
|
||||
|
||||
@ -254,6 +254,9 @@ do ->
|
||||
root.dispatchEvent new CustomEvent event, {bubbles: true, detail: clone detail}
|
||||
<% } %>
|
||||
|
||||
$.modifiedClick = (e) ->
|
||||
e.shiftKey or e.altKey or e.ctrlKey or e.metaKey or e.button isnt 0
|
||||
|
||||
$.open =
|
||||
<% if (type === 'userscript') { %>
|
||||
if GM_openInTab?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user