Change layout for table of contents.

This commit is contained in:
Julia Radzhabova 2017-12-21 13:56:48 +03:00
parent 909e73270a
commit 4c17a79725
5 changed files with 21 additions and 15 deletions

View file

@ -154,11 +154,11 @@ define([
showLast: true, showLast: true,
allowScrollbar: true, allowScrollbar: true,
itemTemplate: _.template([ itemTemplate: _.template([
'<div id="<%= id %>" class="tree-item <% if (!isVisible) { %>' + 'hidden' + '<% } %>" style="display: block;padding-left: <%= level*10 + 26 %>px;">', '<div id="<%= id %>" class="tree-item <% if (!isVisible) { %>' + 'hidden' + '<% } %>" style="display: block;padding-left: <%= level*16 + 24 %>px;">',
'<% if (hasSubItems) { %>', '<% if (hasSubItems) { %>',
'<div class="tree-caret img-commonctrl ' + '<% if (!isExpanded) { %>' + 'up' + '<% } %>' + '" style="margin-left: <%= level*10 %>px;"></div>', '<div class="tree-caret img-commonctrl ' + '<% if (!isExpanded) { %>' + 'up' + '<% } %>' + '" style="margin-left: <%= level*16 %>px;"></div>',
'<% } %>', '<% } %>',
'<div class="name"><%= name %></div>', '<div class="name <% if (isNotHeader) { %>' + 'not-header' + '<% } %>"><%= name %></div>',
'</div>' '</div>'
].join('')) ].join(''))
}, },

View file

@ -28,22 +28,22 @@
.tree-item { .tree-item {
width: 100%; width: 100%;
min-height: 32px; min-height: 28px;
padding: 0px 0 0 26px; padding: 0px 0 0 24px;
} }
.name { .name {
width: 100%; width: 100%;
padding: 7px 0; padding: 5px 0;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.tree-caret { .tree-caret {
width: 26px; width: 24px;
height: 26px; height: 24px;
background-position: 4px -269px; background-position: 3px -270px;
display: inline-block; display: inline-block;
position: absolute; position: absolute;
left: 0; left: 0;

View file

@ -116,6 +116,7 @@ define([
if (count>0 && this._navigationObject.isFirstItemNotHeader()) { if (count>0 && this._navigationObject.isFirstItemNotHeader()) {
arr[0].set('hasSubItems', false); arr[0].set('hasSubItems', false);
arr[0].set('isNotHeader', true); arr[0].set('isNotHeader', true);
arr[0].set('name', this.txtBeginning);
arr[0].set('tip', this.txtGotoBeginning); arr[0].set('tip', this.txtGotoBeginning);
} }
this.getApplication().getCollection('Navigation').reset(arr); this.getApplication().getCollection('Navigation').reset(arr);
@ -173,7 +174,7 @@ define([
var index = parseInt(menu.cmpEl.attr('data-value')); var index = parseInt(menu.cmpEl.attr('data-value'));
if (item.value == 'promote') { if (item.value == 'promote') {
this._navigationObject.promote(index); this._navigationObject.promote(index);
} else if (item.value == 'indent') { } else if (item.value == 'demote') {
this._navigationObject.demote(index); this._navigationObject.demote(index);
} else if (item.value == 'before') { } else if (item.value == 'before') {
this._navigationObject.insertHeader(index, true); this._navigationObject.insertHeader(index, true);
@ -194,6 +195,7 @@ define([
this.panelNavigation.viewNavigationList.expandToLevel(item.value-1); this.panelNavigation.viewNavigationList.expandToLevel(item.value-1);
}, },
txtBeginning: 'Beginning of document',
txtGotoBeginning: 'Go to the beginning of the document' txtGotoBeginning: 'Go to the beginning of the document'
}, DE.Controllers.Navigation || {})); }, DE.Controllers.Navigation || {}));

View file

@ -80,8 +80,8 @@ define([
value: 'promote' value: 'promote'
}, },
{ {
caption : this.txtIndent, caption : this.txtDemote,
value: 'indent' value: 'demote'
}, },
{ {
caption : '--' caption : '--'
@ -148,7 +148,7 @@ define([
strNavigate: 'Table of Contents', strNavigate: 'Table of Contents',
txtPromote: 'Promote', txtPromote: 'Promote',
txtIndent: 'Indent', txtDemote: 'Demote',
txtHeadingBefore: 'New heading before', txtHeadingBefore: 'New heading before',
txtHeadingAfter: 'New heading after', txtHeadingAfter: 'New heading after',
txtNewHeading: 'New subheading', txtNewHeading: 'New subheading',

View file

@ -17,7 +17,11 @@
#navigation-list { #navigation-list {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
padding: 15px 0 10px 0; padding: 8px 0;
font-size: 13px; font-size: 12px;
.name.not-header {
font-style: italic;
}
} }
} }