diff --git a/apps/common/main/lib/component/TreeView.js b/apps/common/main/lib/component/TreeView.js index 12d383107..eb382a14b 100644 --- a/apps/common/main/lib/component/TreeView.js +++ b/apps/common/main/lib/component/TreeView.js @@ -52,6 +52,7 @@ define([ name: '', isNotHeader: false, hasSubItems: false, + hasParent: false, isEmptyItem: false, isExpanded: true, isVisible: true, @@ -113,8 +114,10 @@ define([ collapseAll: function() { for (var i=0; iprev_level && i>0) arr[i-1].set('hasSubItems', true); + if (header_level<0 || level<=header_level) { + if (i>0 || first_header) + header_level = level; + hasParent = false; + } arr.push(new Common.UI.TreeViewModel({ name : this._navigationObject.get_Text(i), level: level, index: i, + hasParent: hasParent, isEmptyItem: this._navigationObject.isEmptyItem(i) })); prev_level = level; } - if (count>0 && this._navigationObject.isFirstItemNotHeader()) { + if (count>0 && !first_header) { arr[0].set('hasSubItems', false); arr[0].set('isNotHeader', true); arr[0].set('name', this.txtBeginning); @@ -176,6 +185,9 @@ define([ top: showPoint[1] }); menu.show(); + _.delay(function() { + menu.cmpEl.focus(); + }, 10); } }, diff --git a/apps/documenteditor/main/app/view/Navigation.js b/apps/documenteditor/main/app/view/Navigation.js index bbaf7153c..a6a14f123 100644 --- a/apps/documenteditor/main/app/view/Navigation.js +++ b/apps/documenteditor/main/app/view/Navigation.js @@ -119,6 +119,7 @@ define([ caption : this.txtExpandToLevel, menu: new Common.UI.Menu({ menuAlign: 'tl-tr', + style: 'min-width: 60px;', items: [{ caption : '1', value: 1 }, { caption : '2', value: 2 }, { caption : '3', value: 3 }, { caption : '4', value: 4 }, { caption : '5', value: 5 }, { caption : '6', value: 6 }, { caption : '7', value: 7 }, { caption : '8', value: 8 }, { caption : '9', value: 9 }