Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangesetList.js
Show First 20 Lines • Show All 1,190 Lines • ▼ Show 20 Lines | _redrawHover: function() { | ||||
var bot = this._hoverTarget; | var bot = this._hoverTarget; | ||||
if (JX.$V(top).y > JX.$V(bot).y) { | if (JX.$V(top).y > JX.$V(bot).y) { | ||||
var tmp = top; | var tmp = top; | ||||
top = bot; | top = bot; | ||||
bot = tmp; | bot = tmp; | ||||
} | } | ||||
// Find the leftmost cell that we're going to highlight: this is the next | // Find the leftmost cell that we're going to highlight: this is the next | ||||
// <td /> in the row. In 2up views, it should be directly adjacent. In | // <td /> in the row that does not have a "data-n" (line number) | ||||
// attribute. In 2up views, it should be directly adjacent. In | |||||
// 1up views, we may have to skip over the other line number column. | // 1up views, we may have to skip over the other line number column. | ||||
var l = top; | var l = top; | ||||
while (JX.DOM.isType(l, 'th')) { | while (l.nextSibling && l.getAttribute('data-n')) { | ||||
l = l.nextSibling; | l = l.nextSibling; | ||||
} | } | ||||
// Find the rightmost cell that we're going to highlight: this is the | // Find the rightmost cell that we're going to highlight: this is the | ||||
// farthest consecutive, adjacent <td /> in the row. Sometimes the left | // farthest consecutive, adjacent <td /> in the row that does not have | ||||
// and right nodes are the same (left side of 2up view); sometimes we're | // a "data-n" (line number) attribute. Sometimes the left and right nodes | ||||
// going to highlight several nodes (copy + code + coverage). | // are the same (left side of 2up view); sometimes we're going to | ||||
// highlight several nodes (copy + code + coverage). | |||||
var r = l; | var r = l; | ||||
while (r.nextSibling && JX.DOM.isType(r.nextSibling, 'td')) { | while (true) { | ||||
// No more cells in the row, so we can't keep expanding. | |||||
if (!r.nextSibling) { | |||||
break; | |||||
} | |||||
if (r.nextSibling.getAttribute('data-n')) { | |||||
break; | |||||
} | |||||
r = r.nextSibling; | r = r.nextSibling; | ||||
} | } | ||||
var pos = JX.$V(l) | var pos = JX.$V(l) | ||||
.add(JX.Vector.getAggregateScrollForNode(l)); | .add(JX.Vector.getAggregateScrollForNode(l)); | ||||
var dim = JX.$V(r) | var dim = JX.$V(r) | ||||
.add(JX.Vector.getAggregateScrollForNode(r)) | .add(JX.Vector.getAggregateScrollForNode(r)) | ||||
▲ Show 20 Lines • Show All 702 Lines • Show Last 20 Lines |