fix edge hovering; close #146
This commit is contained in:
parent
ec849bbcaf
commit
c54d5de6b6
@ -218,14 +218,21 @@
|
|||||||
return d.removeEventListener('mouseup', ui.dragend, true);
|
return d.removeEventListener('mouseup', ui.dragend, true);
|
||||||
},
|
},
|
||||||
hover: function(e) {
|
hover: function(e) {
|
||||||
var bot, clientX, clientY, el, height, top;
|
var bot, clientHeight, clientWidth, clientX, clientY, el, height, top, _ref;
|
||||||
clientX = e.clientX, clientY = e.clientY;
|
clientX = e.clientX, clientY = e.clientY;
|
||||||
el = ui.el;
|
el = ui.el;
|
||||||
|
_ref = d.body, clientHeight = _ref.clientHeight, clientWidth = _ref.clientWidth;
|
||||||
height = el.offsetHeight;
|
height = el.offsetHeight;
|
||||||
top = clientY - 120;
|
top = clientY - 120;
|
||||||
bot = top + height;
|
bot = top + height;
|
||||||
el.style.top = ui.winHeight < height || top < 0 ? '0px' : bot > ui.winHeight ? ui.winHeight - height + 'px' : top + 'px';
|
el.style.top = clientHeight < height || top < 0 ? '0px' : bot > clientHeight ? clientHeight - height + 'px' : top + 'px';
|
||||||
return el.style.left = clientX + 45 + 'px';
|
if (clientX < clientWidth - 400) {
|
||||||
|
el.style.left = clientX + 45 + 'px';
|
||||||
|
return el.style.right = '';
|
||||||
|
} else {
|
||||||
|
el.style.left = '';
|
||||||
|
return el.style.right = clientWidth - clientX + 45 + 'px';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
hoverend: function(e) {
|
hoverend: function(e) {
|
||||||
ui.el.style.top = 'auto';
|
ui.el.style.top = 'auto';
|
||||||
@ -1904,7 +1911,6 @@
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
ui.el = qp;
|
ui.el = qp;
|
||||||
ui.winHeight = d.body.clientHeight;
|
|
||||||
return $.show(qp);
|
return $.show(qp);
|
||||||
},
|
},
|
||||||
parse: function(req, id, threadID) {
|
parse: function(req, id, threadID) {
|
||||||
@ -2189,7 +2195,6 @@
|
|||||||
el.src = null;
|
el.src = null;
|
||||||
el.src = this.parentNode.href;
|
el.src = this.parentNode.href;
|
||||||
ui.el = el;
|
ui.el = el;
|
||||||
ui.winHeight = d.body.clientHeight;
|
|
||||||
return $.show(el);
|
return $.show(el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -136,18 +136,26 @@ ui =
|
|||||||
hover: (e) ->
|
hover: (e) ->
|
||||||
{clientX, clientY} = e
|
{clientX, clientY} = e
|
||||||
{el} = ui
|
{el} = ui
|
||||||
|
{clientHeight, clientWidth} = d.body
|
||||||
height = el.offsetHeight
|
height = el.offsetHeight
|
||||||
|
|
||||||
top = clientY - 120
|
top = clientY - 120
|
||||||
bot = top + height
|
bot = top + height
|
||||||
el.style.top =
|
el.style.top =
|
||||||
if ui.winHeight < height or top < 0
|
if clientHeight < height or top < 0
|
||||||
'0px'
|
'0px'
|
||||||
else if bot > ui.winHeight
|
else if bot > clientHeight
|
||||||
ui.winHeight - height + 'px'
|
clientHeight - height + 'px'
|
||||||
else
|
else
|
||||||
top + 'px'
|
top + 'px'
|
||||||
el.style.left = clientX + 45 + 'px'
|
|
||||||
|
if clientX < clientWidth - 400
|
||||||
|
el.style.left = clientX + 45 + 'px'
|
||||||
|
el.style.right = ''
|
||||||
|
else
|
||||||
|
el.style.left = ''
|
||||||
|
el.style.right = clientWidth - clientX + 45 + 'px'
|
||||||
|
|
||||||
hoverend: (e) ->
|
hoverend: (e) ->
|
||||||
ui.el.style.top = 'auto'
|
ui.el.style.top = 'auto'
|
||||||
$.hide ui.el
|
$.hide ui.el
|
||||||
@ -1494,7 +1502,6 @@ quotePreview =
|
|||||||
threadID = @pathname.split('/').pop() or $.x('ancestor::div[@class="thread"]/div', @).id
|
threadID = @pathname.split('/').pop() or $.x('ancestor::div[@class="thread"]/div', @).id
|
||||||
$.cache @pathname, (-> quotePreview.parse @, id, threadID)
|
$.cache @pathname, (-> quotePreview.parse @, id, threadID)
|
||||||
ui.el = qp
|
ui.el = qp
|
||||||
ui.winHeight = d.body.clientHeight
|
|
||||||
$.show qp
|
$.show qp
|
||||||
parse: (req, id, threadID) ->
|
parse: (req, id, threadID) ->
|
||||||
qp = $ '#qp'
|
qp = $ '#qp'
|
||||||
@ -1674,7 +1681,6 @@ imageHover =
|
|||||||
el.src = null
|
el.src = null
|
||||||
el.src = @parentNode.href
|
el.src = @parentNode.href
|
||||||
ui.el = el
|
ui.el = el
|
||||||
ui.winHeight = d.body.clientHeight
|
|
||||||
$.show el
|
$.show el
|
||||||
|
|
||||||
imgPreloading =
|
imgPreloading =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user