diff --git a/platform/commonUI/general/src/ui/TreeLabelView.js b/platform/commonUI/general/src/ui/TreeLabelView.js index a048662eb7..7566c065a9 100644 --- a/platform/commonUI/general/src/ui/TreeLabelView.js +++ b/platform/commonUI/general/src/ui/TreeLabelView.js @@ -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) : "");