ui.hoverend

This commit is contained in:
James Campos 2011-05-07 20:48:23 -07:00
parent fe0bbb842f
commit 6287bdc4dd
2 changed files with 11 additions and 19 deletions

View File

@ -234,6 +234,9 @@
bot = top + height;
el.style.top = ui.winHeight < height || top < 0 ? '0px' : bot > ui.winHeight ? ui.winHeight - height + 'px' : top + 'px';
return el.style.left = clientX + 45;
},
hoverend: function(e) {
return $.hide(ui.el);
}
};
d = document;
@ -1684,7 +1687,7 @@
quote = _ref[_i];
$.bind(quote, 'mouseover', quotePreview.mouseover);
$.bind(quote, 'mousemove', ui.hover);
_results.push($.bind(quote, 'mouseout', quotePreview.mouseout));
_results.push($.bind(quote, 'mouseout', ui.hoverend));
}
return _results;
},
@ -1710,9 +1713,6 @@
$.show(qp);
return ui.el = qp;
},
mouseout: function(e) {
return $.hide(ui.el);
},
get: function(id, threadID, innerHTML) {
var body, html, reply, _i, _len, _ref;
body = $.el('body', {
@ -1930,24 +1930,19 @@
thumb = _ref2[_i];
$.bind(thumb, 'mouseover', imageHover.cb.mouseover);
$.bind(thumb, 'mousemove', ui.hover);
_results.push($.bind(thumb, 'mouseout', imageHover.cb.mouseout));
_results.push($.bind(thumb, 'mouseout', ui.hoverend));
}
return _results;
},
mouseover: function(e) {
var el;
el = $('#iHover');
el.src = null;
el.src = this.parentNode.href;
$.show(el);
ui.el = el;
ui.winHeight = d.body.clientHeight;
return ui.winWidth = d.body.clientWidth;
},
mouseout: function(e) {
var el;
el = ui.el;
$.hide(el);
return el.src = null;
}
}
};

View File

@ -156,6 +156,8 @@ ui =
else
top + 'px'
el.style.left = clientX + 45
hoverend: (e) ->
$.hide ui.el
#convenience
d = document
@ -1345,7 +1347,7 @@ quotePreview =
for quote in $$ 'a.quotelink', root
$.bind quote, 'mouseover', quotePreview.mouseover
$.bind quote, 'mousemove', ui.hover
$.bind quote, 'mouseout', quotePreview.mouseout
$.bind quote, 'mouseout', ui.hoverend
mouseover: (e) ->
id = @textContent.replace ">>", ''
qp = $ '#qp'
@ -1364,8 +1366,6 @@ quotePreview =
)
$.show qp
ui.el = qp
mouseout: (e) ->
$.hide ui.el
get: (id, threadID, innerHTML) ->
body = $.el 'body', {innerHTML}
@ -1501,18 +1501,15 @@ imageHover =
for thumb in $$ 'img[md5]', root
$.bind thumb, 'mouseover', imageHover.cb.mouseover
$.bind thumb, 'mousemove', ui.hover
$.bind thumb, 'mouseout', imageHover.cb.mouseout
$.bind thumb, 'mouseout', ui.hoverend
mouseover: (e) ->
el = $ '#iHover'
el.src = null
el.src = @parentNode.href
$.show el
ui.el = el
ui.winHeight = d.body.clientHeight
ui.winWidth = d.body.clientWidth
mouseout: (e) ->
{el} = ui
$.hide el
el.src = null
imgPreloading =
init: ->