Don't stop dragging elements when starting to hover. Also some fixes with hovering elements stuck.
This commit is contained in:
parent
f15b920850
commit
7836381564
@ -255,9 +255,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
hoverend: function() {
|
hoverend: function() {
|
||||||
if (!UI.el) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$.rm(UI.el);
|
$.rm(UI.el);
|
||||||
return delete UI.el;
|
return delete UI.el;
|
||||||
}
|
}
|
||||||
@ -3230,7 +3227,15 @@
|
|||||||
if (/\binlined\b/.test(this.className)) {
|
if (/\binlined\b/.test(this.className)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UI.hoverend();
|
if (qp = $.id('qp')) {
|
||||||
|
if (qp === UI.el) {
|
||||||
|
delete UI.el;
|
||||||
|
}
|
||||||
|
$.rm(qp);
|
||||||
|
}
|
||||||
|
if (UI.el) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
qp = UI.el = $.el('div', {
|
qp = UI.el = $.el('div', {
|
||||||
id: 'qp',
|
id: 'qp',
|
||||||
className: 'post reply dialog'
|
className: 'post reply dialog'
|
||||||
@ -3675,19 +3680,28 @@
|
|||||||
return $.on(post.img, 'mouseover', ImageHover.mouseover);
|
return $.on(post.img, 'mouseover', ImageHover.mouseover);
|
||||||
},
|
},
|
||||||
mouseover: function() {
|
mouseover: function() {
|
||||||
UI.hoverend();
|
var el;
|
||||||
UI.el = $.el('img', {
|
if (el = $.id('ihover')) {
|
||||||
|
if (el === UI.el) {
|
||||||
|
delete UI.el;
|
||||||
|
}
|
||||||
|
$.rm(el);
|
||||||
|
}
|
||||||
|
if (UI.el) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
el = UI.el = $.el('img', {
|
||||||
id: 'ihover',
|
id: 'ihover',
|
||||||
src: this.parentNode.href
|
src: this.parentNode.href
|
||||||
});
|
});
|
||||||
$.add(d.body, UI.el);
|
$.add(d.body, el);
|
||||||
$.on(UI.el, 'load', ImageHover.load);
|
$.on(el, 'load', ImageHover.load);
|
||||||
$.on(this, 'mousemove', UI.hover);
|
$.on(this, 'mousemove', UI.hover);
|
||||||
return $.on(this, 'mouseout', ImageHover.mouseout);
|
return $.on(this, 'mouseout', ImageHover.mouseout);
|
||||||
},
|
},
|
||||||
load: function() {
|
load: function() {
|
||||||
var style;
|
var style;
|
||||||
if (this !== UI.el) {
|
if (!this.parentNode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
style = this.style;
|
style = this.style;
|
||||||
|
|||||||
@ -225,9 +225,7 @@ UI =
|
|||||||
else
|
else
|
||||||
style.left = null
|
style.left = null
|
||||||
style.right = clientWidth - clientX + 45 + 'px'
|
style.right = clientWidth - clientX + 45 + 'px'
|
||||||
|
|
||||||
hoverend: ->
|
hoverend: ->
|
||||||
return unless UI.el
|
|
||||||
$.rm UI.el
|
$.rm UI.el
|
||||||
delete UI.el
|
delete UI.el
|
||||||
|
|
||||||
@ -2445,8 +2443,15 @@ QuotePreview =
|
|||||||
mouseover: (e) ->
|
mouseover: (e) ->
|
||||||
return if /\binlined\b/.test @className
|
return if /\binlined\b/.test @className
|
||||||
|
|
||||||
# Make sure to remove the previous UI.el
|
# Make sure to remove the previous qp
|
||||||
UI.hoverend()
|
# in case it got stuck. Opera-only bug?
|
||||||
|
if qp = $.id 'qp'
|
||||||
|
if qp is UI.el
|
||||||
|
delete UI.el
|
||||||
|
$.rm qp
|
||||||
|
|
||||||
|
# Don't stop other elements from dragging
|
||||||
|
return if UI.el
|
||||||
|
|
||||||
qp = UI.el = $.el 'div',
|
qp = UI.el = $.el 'div',
|
||||||
id: 'qp'
|
id: 'qp'
|
||||||
@ -2482,7 +2487,7 @@ QuotePreview =
|
|||||||
$.removeClass el.parentNode, 'qphl'
|
$.removeClass el.parentNode, 'qphl'
|
||||||
else
|
else
|
||||||
$.removeClass el, 'qphl'
|
$.removeClass el, 'qphl'
|
||||||
$.off @, 'mousemove', UI.hover
|
$.off @, 'mousemove', UI.hover
|
||||||
$.off @, 'mouseout click', QuotePreview.mouseout
|
$.off @, 'mouseout click', QuotePreview.mouseout
|
||||||
parse: (req, id) ->
|
parse: (req, id) ->
|
||||||
return unless (qp = UI.el) and qp.textContent is "Loading #{id}..."
|
return unless (qp = UI.el) and qp.textContent is "Loading #{id}..."
|
||||||
@ -2789,18 +2794,25 @@ ImageHover =
|
|||||||
return unless post.img
|
return unless post.img
|
||||||
$.on post.img, 'mouseover', ImageHover.mouseover
|
$.on post.img, 'mouseover', ImageHover.mouseover
|
||||||
mouseover: ->
|
mouseover: ->
|
||||||
# Make sure to remove the previous UI.el
|
# Make sure to remove the previous image hover
|
||||||
UI.hoverend()
|
# in case it got stuck. Opera-only bug?
|
||||||
|
if el = $.id 'ihover'
|
||||||
|
if el is UI.el
|
||||||
|
delete UI.el
|
||||||
|
$.rm el
|
||||||
|
|
||||||
UI.el = $.el 'img'
|
# Don't stop other elements from dragging
|
||||||
|
return if UI.el
|
||||||
|
|
||||||
|
el = UI.el = $.el 'img'
|
||||||
id: 'ihover'
|
id: 'ihover'
|
||||||
src: @parentNode.href
|
src: @parentNode.href
|
||||||
$.add d.body, UI.el
|
$.add d.body, el
|
||||||
$.on UI.el, 'load', ImageHover.load
|
$.on el, 'load', ImageHover.load
|
||||||
$.on @, 'mousemove', UI.hover
|
$.on @, 'mousemove', UI.hover
|
||||||
$.on @, 'mouseout', ImageHover.mouseout
|
$.on @, 'mouseout', ImageHover.mouseout
|
||||||
load: ->
|
load: ->
|
||||||
return if @ isnt UI.el
|
return unless @parentNode
|
||||||
# 'Fake' mousemove event by giving required values.
|
# 'Fake' mousemove event by giving required values.
|
||||||
{style} = @
|
{style} = @
|
||||||
UI.hover
|
UI.hover
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user