Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/phuix/PHUIXActionView.js
| Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | members: { | ||||
| setHref: function(href) { | setHref: function(href) { | ||||
| this._href = href; | this._href = href; | ||||
| this._buildNameNode(true); | this._buildNameNode(true); | ||||
| return this; | return this; | ||||
| }, | }, | ||||
| getNode: function() { | getNode: function() { | ||||
| if (!this._node) { | if (!this._node) { | ||||
| var attr = { | var classes = ['phabricator-action-view']; | ||||
| className: 'phabricator-action-view' | |||||
| }; | if (this._href || this._handler) { | ||||
| classes.push('phabricator-action-view-href'); | |||||
| } | |||||
| if (this._icon) { | |||||
| classes.push('action-has-icon'); | |||||
| } | |||||
| var content = [ | var content = [ | ||||
| this._buildIconNode(), | this._buildIconNode(), | ||||
| this._buildNameNode() | this._buildNameNode() | ||||
| ]; | ]; | ||||
| var attr = { | |||||
| className: classes.join(' ') | |||||
| }; | |||||
| this._node = JX.$N('li', attr, content); | this._node = JX.$N('li', attr, content); | ||||
| } | } | ||||
| return this._node; | return this._node; | ||||
| }, | }, | ||||
| _buildIconNode: function(dirty) { | _buildIconNode: function(dirty) { | ||||
| if (!this._iconNode || dirty) { | if (!this._iconNode || dirty) { | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||