diff --git a/appchan-x.user.js b/appchan-x.user.js index fce475e6e..e4fc0cf8e 100644 --- a/appchan-x.user.js +++ b/appchan-x.user.js @@ -4847,7 +4847,10 @@ this.shortcuts = $.el('span', { id: 'shortcuts' }); - return $.asap((function() { + this.hover = $.el('div', { + id: 'hoverUI' + }); + $.asap((function() { return d.body; }), function() { if (!Main.isThisPageLegit()) { @@ -4857,6 +4860,9 @@ return $.id('boardNavMobile'); }), Header.setBoardList); }); + return $.ready(function() { + return $.add(d.body, Header.hover); + }); }, setBoardList: function() { var a, btn, customBoardList, fullBoardList, nav; @@ -8060,7 +8066,7 @@ id: 'qp', className: 'dialog' }); - $.add(d.body, qp); + $.add(Header.hover, qp); Get.postClone(boardID, threadID, postID, qp, Get.contextFromLink(this)); UI.hover({ root: this, @@ -9060,7 +9066,7 @@ src: post.file.URL }); el.setAttribute('data-fullid', post.fullID); - $.add(d.body, el); + $.add(Header.hover, el); UI.hover({ root: this, el: el, diff --git a/lib/ui.coffee b/lib/ui.coffee index 14b8fe025..d8638f613 100644 --- a/lib/ui.coffee +++ b/lib/ui.coffee @@ -9,7 +9,6 @@ UI = do -> $.on move, 'touchstart mousedown', dragstart el - class Menu currentMenu = null lastToggledButton = null diff --git a/src/features.coffee b/src/features.coffee index 40679807d..dc67a90d9 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -4,12 +4,17 @@ Header = id: 'notifications' @shortcuts = $.el 'span', id: 'shortcuts' + @hover = $.el 'div', + id: 'hoverUI' $.asap (-> d.body), -> return unless Main.isThisPageLegit() # Wait for #boardNavMobile instead of #boardNavDesktop, # it might be incomplete otherwise. $.asap (-> $.id 'boardNavMobile'), Header.setBoardList + $.ready -> + $.add d.body, Header.hover + setBoardList: -> Header.nav = nav = $.id 'boardNavDesktop' @@ -2687,10 +2692,12 @@ QuotePreview = Post::callbacks.push name: 'Quote Previewing' cb: @node + node: -> for link in @nodes.quotelinks.concat [@nodes.backlinks...] $.on link, 'mouseover', QuotePreview.mouseover return + mouseover: (e) -> return if $.hasClass @, 'inlined' @@ -2699,7 +2706,7 @@ QuotePreview = qp = $.el 'div', id: 'qp' className: 'dialog' - $.add d.body, qp + $.add Header.hover, qp Get.postClone boardID, threadID, postID, qp, Get.contextFromLink @ UI.hover @@ -2725,6 +2732,7 @@ QuotePreview = if quote.hash[2..] is quoterID $.addClass quote, 'forwardlink' return + mouseout: -> # Stop if it only contains text. return unless root = @el.firstElementChild @@ -3425,7 +3433,7 @@ ImageHover = id: 'ihover' src: post.file.URL el.setAttribute 'data-fullid', post.fullID - $.add d.body, el + $.add Header.hover, el UI.hover root: @ el: el