Move repeated code into $.modifiedClick.
This commit is contained in:
parent
167f4e97ba
commit
c2a2dafe7f
@ -297,7 +297,7 @@ Index =
|
|||||||
Index.pageLoad()
|
Index.pageLoad()
|
||||||
|
|
||||||
pageNav: (e) ->
|
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
|
switch e.target.nodeName
|
||||||
when 'BUTTON'
|
when 'BUTTON'
|
||||||
e.target.blur()
|
e.target.blur()
|
||||||
|
|||||||
@ -41,7 +41,7 @@ ImageExpand =
|
|||||||
|
|
||||||
cb:
|
cb:
|
||||||
toggle: (e) ->
|
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 @
|
post = Get.postFromNode @
|
||||||
{file} = post
|
{file} = post
|
||||||
return if file.isExpanded and ImageCommon.onControls e
|
return if file.isExpanded and ImageCommon.onControls e
|
||||||
|
|||||||
@ -29,7 +29,7 @@ ExpandThread =
|
|||||||
ExpandThread.setButton thread
|
ExpandThread.setButton thread
|
||||||
|
|
||||||
cbToggle: (e) ->
|
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()
|
e.preventDefault()
|
||||||
ExpandThread.toggle Get.threadFromNode @
|
ExpandThread.toggle Get.threadFromNode @
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ QuoteInline =
|
|||||||
href: link.href
|
href: link.href
|
||||||
|
|
||||||
toggle: (e) ->
|
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 @
|
{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
|
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}
|
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 =
|
$.open =
|
||||||
<% if (type === 'userscript') { %>
|
<% if (type === 'userscript') { %>
|
||||||
if GM_openInTab?
|
if GM_openInTab?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user