Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangeset.js
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | construct : function(node) { | ||||
| this._isLoading = true; | this._isLoading = true; | ||||
| this._inlines = []; | this._inlines = []; | ||||
| if (data.changesetState) { | if (data.changesetState) { | ||||
| this._loadChangesetState(data.changesetState); | this._loadChangesetState(data.changesetState); | ||||
| } | } | ||||
| JX.enableDispatch(window, 'selectstart'); | |||||
| var onselect = JX.bind(this, this._onClickHeader); | var onselect = JX.bind(this, this._onClickHeader); | ||||
| JX.DOM.listen(this._node, 'mousedown', 'changeset-header', onselect); | JX.DOM.listen( | ||||
| this._node, | |||||
| ['mousedown', 'selectstart'], | |||||
| 'changeset-header', | |||||
| onselect); | |||||
| }, | }, | ||||
| members: { | members: { | ||||
| _node: null, | _node: null, | ||||
| _loaded: false, | _loaded: false, | ||||
| _sequence: 0, | _sequence: 0, | ||||
| _stabilize: false, | _stabilize: false, | ||||
| ▲ Show 20 Lines • Show All 839 Lines • ▼ Show 20 Lines | members: { | ||||
| _onClickHeader: function(e) { | _onClickHeader: function(e) { | ||||
| // If the user clicks the actual path name text, don't count this as | // If the user clicks the actual path name text, don't count this as | ||||
| // a selection action: we want to let them select the path. | // a selection action: we want to let them select the path. | ||||
| var path_name = e.getNode('changeset-header-path-name'); | var path_name = e.getNode('changeset-header-path-name'); | ||||
| if (path_name) { | if (path_name) { | ||||
| return; | return; | ||||
| } | } | ||||
| // Don't allow repeatedly clicking a header to begin a "select word" or | |||||
| // "select line" operation. | |||||
| if (e.getType() === 'selectstart') { | |||||
| e.kill(); | |||||
| return; | |||||
| } | |||||
| // NOTE: Don't prevent or kill the event. If the user has text selected, | // NOTE: Don't prevent or kill the event. If the user has text selected, | ||||
| // clicking a header should clear the selection (and dismiss any inline | // clicking a header should clear the selection (and dismiss any inline | ||||
| // context menu, if one exists) as clicking elsewhere in the document | // context menu, if one exists) as clicking elsewhere in the document | ||||
| // normally would. | // normally would. | ||||
| if (this._isSelected) { | if (this._isSelected) { | ||||
| this.getChangesetList().selectChangeset(null); | this.getChangesetList().selectChangeset(null); | ||||
| } else { | } else { | ||||
| ▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines | |||||