Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangesetList.js
| Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | construct: function() { | ||||
| var onhover = JX.bind(this, this._ifawake, this._onhover); | var onhover = JX.bind(this, this._ifawake, this._onhover); | ||||
| JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
| ['mouseover', 'mouseout'], | ['mouseover', 'mouseout'], | ||||
| 'differential-inline-comment', | 'differential-inline-comment', | ||||
| onhover); | onhover); | ||||
| var onrangedown = JX.bind(this, this._ifawake, this._onrangedown); | var onrangedown = JX.bind(this, this._ifawake, this._onrangedown); | ||||
| JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
| ['touchstart', 'mousedown'], | 'mousedown', | ||||
| ['differential-changeset', 'tag:th'], | ['differential-changeset', 'tag:th'], | ||||
| onrangedown); | onrangedown); | ||||
| var onrangemove = JX.bind(this, this._ifawake, this._onrangemove); | var onrangemove = JX.bind(this, this._ifawake, this._onrangemove); | ||||
| JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
| ['mouseover', 'mouseout'], | ['mouseover', 'mouseout'], | ||||
| ['differential-changeset', 'tag:th'], | ['differential-changeset', 'tag:th'], | ||||
| onrangemove); | onrangemove); | ||||
| var onrangetouchmove = JX.bind(this, this._ifawake, this._onrangetouchmove); | |||||
| JX.Stratcom.listen( | |||||
| 'touchmove', | |||||
| null, | |||||
| onrangetouchmove); | |||||
| var onrangeup = JX.bind(this, this._ifawake, this._onrangeup); | var onrangeup = JX.bind(this, this._ifawake, this._onrangeup); | ||||
| JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
| ['touchend', 'mouseup'], | 'mouseup', | ||||
| null, | null, | ||||
| onrangeup); | onrangeup); | ||||
| }, | }, | ||||
| properties: { | properties: { | ||||
| translations: null, | translations: null, | ||||
| inlineURI: null | inlineURI: null | ||||
| }, | }, | ||||
| ▲ Show 20 Lines • Show All 1,044 Lines • ▼ Show 20 Lines | getLineNumberFromHeader: function(th) { | ||||
| } | } | ||||
| }, | }, | ||||
| 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 touch events through, including "touchstart". We | // NOTE: We're allowing "mousedown" from a touch event through so users | ||||
| // need to kill the "touchstart" event so the page doesn't scroll. | // can leave inlines on a single line. | ||||
| if (e.isRightButton()) { | if (e.isRightButton()) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (this._rangeActive) { | if (this._rangeActive) { | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | _updateRange: function(target, is_out) { | ||||
| } else { | } else { | ||||
| this._rangeOrigin = target; | this._rangeOrigin = target; | ||||
| this._rangeTarget = target; | this._rangeTarget = target; | ||||
| } | } | ||||
| this._setHoverRange(this._rangeOrigin, this._rangeTarget); | this._setHoverRange(this._rangeOrigin, this._rangeTarget); | ||||
| }, | }, | ||||
| _onrangetouchmove: function(e) { | |||||
| if (!this._rangeActive) { | |||||
| return; | |||||
| } | |||||
| // NOTE: The target of a "touchmove" event is bogus. Use dark magic to | |||||
| // identify the actual target. Some day, this might move into the core | |||||
| // libraries. If this doesn't work, just bail. | |||||
| var target; | |||||
| try { | |||||
| var raw_event = e.getRawEvent(); | |||||
| var touch = raw_event.touches[0]; | |||||
| target = document.elementFromPoint(touch.clientX, touch.clientY); | |||||
| } catch (ex) { | |||||
| return; | |||||
| } | |||||
| if (!JX.DOM.isType(target, 'th')) { | |||||
| return; | |||||
| } | |||||
| this._updateRange(target, false); | |||||
| }, | |||||
| _onrangeup: function(e) { | _onrangeup: function(e) { | ||||
| if (!this._rangeActive) { | if (!this._rangeActive) { | ||||
| return; | return; | ||||
| } | } | ||||
| e.kill(); | e.kill(); | ||||
| var origin = this._rangeOrigin; | var origin = this._rangeOrigin; | ||||
| ▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines | |||||