mirror of
https://github.com/nasa/openmct.git
synced 2025-04-15 06:56:43 +00:00
fixes issue 1973 and 1911 (#1992)
Remove previous icon class name before adding the new class name
This commit is contained in:
parent
19fc05b76d
commit
94c35a67c5
@ -40,10 +40,18 @@ define([
|
||||
return type.getCssClass();
|
||||
}
|
||||
|
||||
function removePreviousIconClass(el) {
|
||||
$(el).removeClass(function (index, className) {
|
||||
return (className.match (/\bicon-\S+/g) || []).join(' ');
|
||||
});
|
||||
}
|
||||
|
||||
TreeLabelView.prototype.updateView = function (domainObject) {
|
||||
var titleEl = this.el.find('.t-title-label'),
|
||||
iconEl = this.el.find('.t-item-icon');
|
||||
|
||||
removePreviousIconClass(iconEl);
|
||||
|
||||
titleEl.text(domainObject ? domainObject.getModel().name : "");
|
||||
iconEl.addClass(domainObject ? getClass(domainObject) : "");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user