Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangesetList.js
| Show First 20 Lines • Show All 1,240 Lines • ▼ Show 20 Lines | _getInlineForEvent: function(e) { | ||||
| } | } | ||||
| var changeset = this.getChangesetForNode(node); | var changeset = this.getChangesetForNode(node); | ||||
| var inline_row = e.getNode('inline-row'); | var inline_row = e.getNode('inline-row'); | ||||
| return changeset.getInlineForRow(inline_row); | return changeset.getInlineForRow(inline_row); | ||||
| }, | }, | ||||
| getLineNumberFromHeader: function(th) { | getLineNumberFromHeader: function(node) { | ||||
| return parseInt(th.getAttribute('data-n')); | var n = parseInt(node.getAttribute('data-n')); | ||||
| if (!n) { | |||||
| return null; | |||||
| } | |||||
| // If this is a line number that's part of a row showing more context, | |||||
| // we don't want to let users leave inlines here. | |||||
| try { | |||||
| JX.DOM.findAbove(node, 'tr', 'context-target'); | |||||
| return null; | |||||
| } catch (ex) { | |||||
| // Ignore. | |||||
| } | |||||
| return n; | |||||
| }, | }, | ||||
| getDisplaySideFromHeader: function(th) { | getDisplaySideFromHeader: function(th) { | ||||
| return (th.parentNode.firstChild != th) ? 'right' : 'left'; | return (th.parentNode.firstChild != th) ? 'right' : 'left'; | ||||
| }, | }, | ||||
| _onrangedown: function(e) { | _onrangedown: function(e) { | ||||
| // NOTE: We're allowing "mousedown" from a touch event through so users | // NOTE: We're allowing "mousedown" from a touch event through so users | ||||
| Show All 31 Lines | _onrangemove: function(e) { | ||||
| var is_out = (e.getType() == 'mouseout'); | var is_out = (e.getType() == 'mouseout'); | ||||
| var target = e.getTarget(); | var target = e.getTarget(); | ||||
| this._updateRange(target, is_out); | this._updateRange(target, is_out); | ||||
| }, | }, | ||||
| _updateRange: function(target, is_out) { | _updateRange: function(target, is_out) { | ||||
| // Don't update the range if this "<th />" doesn't correspond to a line | // Don't update the range if this target doesn't correspond to a line | ||||
| // number. For instance, this may be a dead line number, like the empty | // number. For instance, this may be a dead line number, like the empty | ||||
| // line numbers on the left hand side of a newly added file. | // line numbers on the left hand side of a newly added file. | ||||
| var number = this.getLineNumberFromHeader(target); | var number = this.getLineNumberFromHeader(target); | ||||
| if (!number) { | if (!number) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (this._rangeActive) { | if (this._rangeActive) { | ||||
| ▲ Show 20 Lines • Show All 578 Lines • Show Last 20 Lines | |||||