1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 21:40:55 +01:00
phorge-phorge/webroot/rsrc/js/phuix/PHUIXIconView.js
epriestley dc0d914134 Basic stacked action support for EditEngine
Summary: Ref T9132. This still has a lot of rough edges but the basics seem to work OK.

Test Plan: {F1012627}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14653
2015-12-03 12:32:02 -08:00

47 lines
920 B
JavaScript

/**
* @provides phuix-icon-view
* @requires javelin-install
* javelin-dom
*/
JX.install('PHUIXIconView', {
members: {
_node: null,
_icon: null,
_color: null,
setIcon: function(icon) {
var node = this.getNode();
if (this._icon) {
JX.DOM.alterClass(node, this._icon, false);
}
this._icon = icon;
JX.DOM.alterClass(node, this._icon, true);
return this;
},
setColor: function(color) {
var node = this.getNode();
if (this._color) {
JX.DOM.alterClass(node, this._color, false);
}
this._color = color;
JX.DOM.alterClass(node, this._color, true);
return this;
},
getNode: function() {
if (!this._node) {
var attrs = {
className: 'phui-icon-view phui-font-fa'
};
this._node = JX.$N('span', attrs);
}
return this._node;
}
}
});