Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffPathView.js
| Show All 14 Lines | members: { | ||||
| _depth: 0, | _depth: 0, | ||||
| _selected: false, | _selected: false, | ||||
| _focused: false, | _focused: false, | ||||
| _icon: null, | _icon: null, | ||||
| _indentNode: null, | _indentNode: null, | ||||
| _pathNode: null, | _pathNode: null, | ||||
| _changeset: null, | _changeset: null, | ||||
| _inlineNode: null, | |||||
| getNode: function() { | getNode: function() { | ||||
| if (!this._node) { | if (!this._node) { | ||||
| var attrs = { | var attrs = { | ||||
| className: 'diff-tree-path' | className: 'diff-tree-path' | ||||
| }; | }; | ||||
| this._node = JX.$N('li', attrs, this._getIndentNode()); | this._node = JX.$N('li', attrs, this._getIndentNode()); | ||||
| Show All 35 Lines | members: { | ||||
| getPath: function() { | getPath: function() { | ||||
| return this._path; | return this._path; | ||||
| }, | }, | ||||
| setDepth: function(depth) { | setDepth: function(depth) { | ||||
| this._depth = depth; | this._depth = depth; | ||||
| this._getIndentNode().style.marginLeft = (8 * this._depth) + 'px'; | this._getIndentNode().style.marginLeft = (6 * this._depth) + 'px'; | ||||
| return this; | return this; | ||||
| }, | }, | ||||
| setIsSelected: function(selected) { | setIsSelected: function(selected) { | ||||
| this._selected = selected; | this._selected = selected; | ||||
| var node = this.getNode(); | var node = this.getNode(); | ||||
| Show All 21 Lines | _onclick: function(e) { | ||||
| changeset.select(true); | changeset.select(true); | ||||
| } | } | ||||
| e.kill(); | e.kill(); | ||||
| }, | }, | ||||
| _getIndentNode: function() { | _getIndentNode: function() { | ||||
| if (!this._indentNode) { | if (!this._indentNode) { | ||||
| var attrs = { | |||||
| className: 'diff-tree-path-indent' | |||||
| }; | |||||
| var content = [ | var content = [ | ||||
| this.getInlineNode(), | |||||
| this._getIconNode(), | this._getIconNode(), | ||||
| this._getPathNode(), | this._getPathNode(), | ||||
| ]; | ]; | ||||
| this._indentNode = JX.$N('div', {}, content); | this._indentNode = JX.$N('div', attrs, content); | ||||
| } | } | ||||
| return this._indentNode; | return this._indentNode; | ||||
| }, | }, | ||||
| _getPathNode: function() { | _getPathNode: function() { | ||||
| if (!this._pathNode) { | if (!this._pathNode) { | ||||
| var attrs = { | var attrs = { | ||||
| className: 'diff-tree-path-name' | className: 'diff-tree-path-name' | ||||
| }; | }; | ||||
| this._pathNode = JX.$N('div', attrs); | this._pathNode = JX.$N('div', attrs); | ||||
| } | } | ||||
| return this._pathNode; | return this._pathNode; | ||||
| }, | }, | ||||
| _getIconNode: function() { | _getIconNode: function() { | ||||
| if (!this._iconNode) { | if (!this._iconNode) { | ||||
| var attrs = { | var attrs = { | ||||
| className: 'diff-tree-path-icon', | className: 'diff-tree-path-icon', | ||||
| }; | }; | ||||
| this._iconNode = JX.$N('div', attrs, this.getIcon().getNode()); | this._iconNode = JX.$N('div', attrs, this.getIcon().getNode()); | ||||
| } | } | ||||
| return this._iconNode; | return this._iconNode; | ||||
| }, | |||||
| getInlineNode: function() { | |||||
| if (!this._inlineNode) { | |||||
| var attrs = { | |||||
| className: 'diff-tree-path-inlines', | |||||
| }; | |||||
| this._inlineNode = JX.$N('div', attrs, '-'); | |||||
| } | |||||
| return this._inlineNode; | |||||
| } | } | ||||
| } | } | ||||
| }); | }); | ||||