Change style for the empty headers.
This commit is contained in:
parent
4c17a79725
commit
b11e896521
|
@ -153,14 +153,7 @@ define([
|
||||||
handleSelect: true,
|
handleSelect: true,
|
||||||
showLast: true,
|
showLast: true,
|
||||||
allowScrollbar: true,
|
allowScrollbar: true,
|
||||||
itemTemplate: _.template([
|
emptyItemText: ''
|
||||||
'<div id="<%= id %>" class="tree-item <% if (!isVisible) { %>' + 'hidden' + '<% } %>" style="display: block;padding-left: <%= level*16 + 24 %>px;">',
|
|
||||||
'<% if (hasSubItems) { %>',
|
|
||||||
'<div class="tree-caret img-commonctrl ' + '<% if (!isExpanded) { %>' + 'up' + '<% } %>' + '" style="margin-left: <%= level*16 %>px;"></div>',
|
|
||||||
'<% } %>',
|
|
||||||
'<div class="name <% if (isNotHeader) { %>' + 'not-header' + '<% } %>"><%= name %></div>',
|
|
||||||
'</div>'
|
|
||||||
].join(''))
|
|
||||||
},
|
},
|
||||||
|
|
||||||
template: _.template([
|
template: _.template([
|
||||||
|
@ -169,6 +162,19 @@ define([
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
options.store = options.store || new Common.UI.TreeViewStore();
|
options.store = options.store || new Common.UI.TreeViewStore();
|
||||||
|
options.emptyItemText = options.emptyItemText || '';
|
||||||
|
options.itemTemplate = options.itemTemplate || _.template([
|
||||||
|
'<div id="<%= id %>" class="tree-item <% if (!isVisible) { %>' + 'hidden' + '<% } %>" style="display: block;padding-left: <%= level*16 + 24 %>px;">',
|
||||||
|
'<% if (hasSubItems) { %>',
|
||||||
|
'<div class="tree-caret img-commonctrl ' + '<% if (!isExpanded) { %>' + 'up' + '<% } %>' + '" style="margin-left: <%= level*16 %>px;"></div>',
|
||||||
|
'<% } %>',
|
||||||
|
'<% if (name!=="") { %>',
|
||||||
|
' <div class="name <% if (isNotHeader) { %>' + 'not-header' + '<% } %>"><%= name %></div>',
|
||||||
|
'<% } else { %>',
|
||||||
|
' <div class="name empty">' + options.emptyItemText + '</div>',
|
||||||
|
'<% } %>',
|
||||||
|
'</div>'
|
||||||
|
].join(''));
|
||||||
Common.UI.DataView.prototype.initialize.call(this, options);
|
Common.UI.DataView.prototype.initialize.call(this, options);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,11 @@
|
||||||
&.selected {
|
&.selected {
|
||||||
background-color: @secondary;
|
background-color: @secondary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.selected .empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-item {
|
.tree-item {
|
||||||
|
@ -38,6 +43,11 @@
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
&.empty {
|
||||||
|
color: #999;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tree-caret {
|
.tree-caret {
|
||||||
|
|
|
@ -71,7 +71,9 @@ define([
|
||||||
this.viewNavigationList = new Common.UI.TreeView({
|
this.viewNavigationList = new Common.UI.TreeView({
|
||||||
el: $('#navigation-list'),
|
el: $('#navigation-list'),
|
||||||
store: this.storeNavigation,
|
store: this.storeNavigation,
|
||||||
enableKeyEvents: false
|
enableKeyEvents: false,
|
||||||
|
emptyText: this.txtEmpty,
|
||||||
|
emptyItemText: this.txtEmptyItem
|
||||||
});
|
});
|
||||||
this.viewNavigationList.cmpEl.off('click');
|
this.viewNavigationList.cmpEl.off('click');
|
||||||
this.navigationMenu = new Common.UI.Menu({
|
this.navigationMenu = new Common.UI.Menu({
|
||||||
|
@ -155,7 +157,9 @@ define([
|
||||||
txtSelect: 'Select content',
|
txtSelect: 'Select content',
|
||||||
txtExpand: 'Expand all',
|
txtExpand: 'Expand all',
|
||||||
txtCollapse: 'Collapse all',
|
txtCollapse: 'Collapse all',
|
||||||
txtExpandToLevel: 'Expand to level...'
|
txtExpandToLevel: 'Expand to level...',
|
||||||
|
txtEmpty: 'This document doesn\'t contain headings',
|
||||||
|
txtEmptyItem: 'Empty Heading'
|
||||||
|
|
||||||
}, DE.Views.Navigation || {}));
|
}, DE.Views.Navigation || {}));
|
||||||
});
|
});
|
Loading…
Reference in a new issue