', { 'class': 'fa fa-spinner fa-pulse' });
@@ -1719,16 +1720,22 @@ define([
var active = privateData.category || 'account';
if (!categories[active]) { active = 'account'; }
Object.keys(categories).forEach(function(key) {
- var $category = $('', {
- 'class': 'cp-sidebarlayout-category',
- 'data-category': key
- }).appendTo($categories);
-
var iconClass = SIDEBAR_ICONS[key];
+ var icon;
if (iconClass) {
- $category.append($('', { 'class': iconClass }));
+ icon = h('span', {
+ class: iconClass,
+ });
}
+ var $category = $(h('div.cp-sidebarlayout-category', {
+ 'data-category': key
+ }, [
+ icon,
+ Messages['settings_cat_' + key] || key,
+ ])).appendTo($categories);
+
+
if (key === active) {
$category.addClass('cp-leftside-active');
}
@@ -1744,8 +1751,6 @@ define([
$category.addClass('cp-leftside-active');
showCategories(categories[key]);
});
-
- $category.append(Messages['settings_cat_' + key] || key);
});
showCategories(categories[active]);
common.setHash(active);