Skip to content

Commit 787f26a

Browse files
committed
feat: set title and attribute using the functions
1 parent f5694a2 commit 787f26a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/view/PanelView.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ define(function (require, exports, module) {
112112
}
113113
let title = panel._tabTitle || _getPanelTitle(panelId, panel.$panel);
114114
let isActive = (panelId === _activeId);
115-
let $tab = $('<div class="bottom-panel-tab' + (isActive ? ' active' : '') + '" data-panel-id="' + panelId + '">' +
116-
'<span class="bottom-panel-tab-title">' + $("<span>").text(title).html() + '</span>' +
117-
'<span class="bottom-panel-tab-close-btn" title="' + Strings.CLOSE + '">&times;</span>' +
118-
'</div>');
115+
let $tab = $('<div class="bottom-panel-tab"></div>')
116+
.toggleClass('active', isActive)
117+
.attr('data-panel-id', panelId);
118+
$tab.append($('<span class="bottom-panel-tab-title"></span>').text(title));
119+
$tab.append($('<span class="bottom-panel-tab-close-btn">&times;</span>').attr('title', Strings.CLOSE));
119120
_$tabsOverflow.append($tab);
120121
});
121122
}

0 commit comments

Comments
 (0)