Handle hovering a bit differently.
This commit is contained in:
parent
f453276a9c
commit
5833ad4fda
@ -1096,7 +1096,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()) {
|
||||
@ -1106,6 +1109,9 @@
|
||||
return $.id('boardNavMobile');
|
||||
}), Header.setBoardList);
|
||||
});
|
||||
return $.ready(function() {
|
||||
return $.add(d.body, Header.hover);
|
||||
});
|
||||
},
|
||||
setBoardList: function() {
|
||||
var a, btn, customBoardList, fullBoardList, nav;
|
||||
@ -4298,7 +4304,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,
|
||||
@ -5298,7 +5304,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,
|
||||
|
||||
@ -9,7 +9,6 @@ UI = do ->
|
||||
$.on move, 'touchstart mousedown', dragstart
|
||||
el
|
||||
|
||||
|
||||
class Menu
|
||||
currentMenu = null
|
||||
lastToggledButton = null
|
||||
|
||||
@ -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'
|
||||
@ -2679,10 +2684,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'
|
||||
|
||||
@ -2691,7 +2698,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
|
||||
@ -2717,6 +2724,7 @@ QuotePreview =
|
||||
if quote.hash[2..] is quoterID
|
||||
$.addClass quote, 'forwardlink'
|
||||
return
|
||||
|
||||
mouseout: ->
|
||||
# Stop if it only contains text.
|
||||
return unless root = @el.firstElementChild
|
||||
@ -3417,7 +3425,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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user