Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffPathView.js
| Show All 17 Lines | members: { | ||||
| _icon: null, | _icon: null, | ||||
| _indentNode: null, | _indentNode: null, | ||||
| _pathNode: null, | _pathNode: null, | ||||
| _changeset: null, | _changeset: null, | ||||
| _inlineNode: null, | _inlineNode: null, | ||||
| _isDirectory: false, | _isDirectory: false, | ||||
| _displayPath: null, | _displayPath: null, | ||||
| _isOwned: false, | |||||
| _isLowImportance: false, | _isLowImportance: false, | ||||
| _isOwned: false, | |||||
| _isHidden: false, | |||||
| _isLoading: false, | |||||
| 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 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | setIsOwned: function(owned) { | ||||
| this._isOwned = owned; | this._isOwned = owned; | ||||
| var node = this.getNode(); | var node = this.getNode(); | ||||
| JX.DOM.alterClass(node, 'diff-tree-path-owned', this._isOwned); | JX.DOM.alterClass(node, 'diff-tree-path-owned', this._isOwned); | ||||
| return this; | return this; | ||||
| }, | }, | ||||
| setIsHidden: function(hidden) { | |||||
| this._isHidden = hidden; | |||||
| var node = this.getNode(); | |||||
| JX.DOM.alterClass(node, 'diff-tree-path-hidden', this._isHidden); | |||||
| return this; | |||||
| }, | |||||
| setIsLoading: function(loading) { | |||||
| this._isLoading = loading; | |||||
| var node = this.getNode(); | |||||
| JX.DOM.alterClass(node, 'diff-tree-path-loading', this._isLoading); | |||||
| return this; | |||||
| }, | |||||
| _onclick: function(e) { | _onclick: function(e) { | ||||
| if (!e.isNormalClick()) { | if (!e.isNormalClick()) { | ||||
| return; | return; | ||||
| } | } | ||||
| var changeset = this.getChangeset(); | var changeset = this.getChangeset(); | ||||
| if (changeset) { | if (changeset) { | ||||
| changeset.select(true); | changeset.select(true); | ||||
| } | } | ||||
| e.kill(); | e.kill(); | ||||
| }, | }, | ||||
| _getIndentNode: function() { | _getIndentNode: function() { | ||||
| if (!this._indentNode) { | if (!this._indentNode) { | ||||
| var attrs = { | var attrs = { | ||||
| className: 'diff-tree-path-indent' | className: 'diff-tree-path-indent' | ||||
| }; | }; | ||||
| var content = [ | var content = [ | ||||
| this.getInlineNode(), | this.getInlineNode(), | ||||
| this._getHiddenIconNode(), | |||||
| this._getIconNode(), | this._getIconNode(), | ||||
| this._getPathNode(), | this._getPathNode(), | ||||
| ]; | ]; | ||||
| this._indentNode = JX.$N('div', attrs, 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 diff-tree-path-icon-kind', | ||||
| }; | }; | ||||
| this._iconNode = JX.$N('div', attrs, this.getIcon().getNode()); | this._iconNode = JX.$N('div', attrs, this.getIcon().getNode()); | ||||
| } | } | ||||
| return this._iconNode; | return this._iconNode; | ||||
| }, | }, | ||||
| _getHiddenIconNode: function() { | |||||
| if (!this._hiddenIconNode) { | |||||
| var attrs = { | |||||
| className: 'diff-tree-path-icon diff-tree-path-icon-hidden', | |||||
| }; | |||||
| this._hiddenIconNode = | |||||
| JX.$N('div', attrs, this._getHiddenIcon().getNode()); | |||||
| } | |||||
| return this._hiddenIconNode; | |||||
| }, | |||||
| _getHiddenIcon: function() { | |||||
| if (!this._hiddenIcon) { | |||||
| this._hiddenIcon = new JX.PHUIXIconView() | |||||
| .setIcon('fa-times-circle-o'); | |||||
| } | |||||
| return this._hiddenIcon; | |||||
| }, | |||||
| getInlineNode: function() { | getInlineNode: function() { | ||||
| if (!this._inlineNode) { | if (!this._inlineNode) { | ||||
| var attrs = { | var attrs = { | ||||
| className: 'diff-tree-path-inlines', | className: 'diff-tree-path-inlines', | ||||
| }; | }; | ||||
| this._inlineNode = JX.$N('div', attrs, '-'); | this._inlineNode = JX.$N('div', attrs, '-'); | ||||
| } | } | ||||
| return this._inlineNode; | return this._inlineNode; | ||||
| Show All 22 Lines | |||||