Add focus to menu with dataview items
This commit is contained in:
parent
302db500de
commit
03069417fb
|
@ -701,7 +701,8 @@ define([
|
|||
} else if (data.keyCode==Common.UI.Keys.UP) {
|
||||
if (topIdx==0 && this.outerMenu && this.outerMenu.menu) {
|
||||
this.deselectAll(true);
|
||||
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
||||
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
||||
return;
|
||||
} else
|
||||
while (idx===undefined) {
|
||||
topIdx--;
|
||||
|
@ -711,7 +712,8 @@ define([
|
|||
} else {
|
||||
if (topIdx==this._layoutParams.rows-1 && this.outerMenu && this.outerMenu.menu) {
|
||||
this.deselectAll(true);
|
||||
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
||||
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
||||
return;
|
||||
} else
|
||||
while (idx===undefined) {
|
||||
topIdx++;
|
||||
|
@ -1171,7 +1173,8 @@ define([
|
|||
} else if (data.keyCode==Common.UI.Keys.UP) {
|
||||
if (topIdx==0 && this.outerMenu && this.outerMenu.menu) {
|
||||
this.deselectAll(true);
|
||||
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
||||
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
||||
return;
|
||||
} else
|
||||
while (idx===undefined) {
|
||||
topIdx--;
|
||||
|
@ -1181,7 +1184,8 @@ define([
|
|||
} else {
|
||||
if (topIdx==this._layoutParams.rows-1 && this.outerMenu && this.outerMenu.menu) {
|
||||
this.deselectAll(true);
|
||||
this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
||||
this.outerMenu.menu.focusOuter && this.outerMenu.menu.focusOuter(data, this.outerMenu.index);
|
||||
return;
|
||||
} else
|
||||
while (idx===undefined) {
|
||||
topIdx++;
|
||||
|
|
|
@ -2181,10 +2181,13 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
onInsertPageNumberClick: function(picker, item, record) {
|
||||
onInsertPageNumberClick: function(picker, item, record, e) {
|
||||
if (this.api)
|
||||
this.api.put_PageNum(record.get('data').type, record.get('data').subtype);
|
||||
|
||||
if (e.type !== 'click')
|
||||
this.toolbar.btnEditHeader.menu.hide();
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||
Common.component.Analytics.trackEvent('ToolBar', 'Page Number');
|
||||
},
|
||||
|
|
|
@ -2080,9 +2080,11 @@ define([
|
|||
this.mnuPageNumberPosPicker = new Common.UI.DataView({
|
||||
el: $('#id-toolbar-menu-pageposition'),
|
||||
allowScrollbar: false,
|
||||
parentMenu: this.mnuInsertPageNum.menu,
|
||||
outerMenu: {menu: this.mnuInsertPageNum.menu, index: 0},
|
||||
showLast: false,
|
||||
store: new Common.UI.DataViewStore([
|
||||
{
|
||||
allowSelected: false,
|
||||
iconname: 'page-number-top-left',
|
||||
data: {
|
||||
type: c_pageNumPosition.PAGE_NUM_POSITION_TOP,
|
||||
|
@ -2090,7 +2092,6 @@ define([
|
|||
}
|
||||
},
|
||||
{
|
||||
allowSelected: false,
|
||||
iconname: 'page-number-top-center',
|
||||
data: {
|
||||
type: c_pageNumPosition.PAGE_NUM_POSITION_TOP,
|
||||
|
@ -2098,7 +2099,6 @@ define([
|
|||
}
|
||||
},
|
||||
{
|
||||
allowSelected: false,
|
||||
iconname: 'page-number-top-right',
|
||||
data: {
|
||||
type: c_pageNumPosition.PAGE_NUM_POSITION_TOP,
|
||||
|
@ -2106,7 +2106,6 @@ define([
|
|||
}
|
||||
},
|
||||
{
|
||||
allowSelected: false,
|
||||
iconname: 'page-number-bottom-left',
|
||||
data: {
|
||||
type: c_pageNumPosition.PAGE_NUM_POSITION_BOTTOM,
|
||||
|
@ -2114,7 +2113,6 @@ define([
|
|||
}
|
||||
},
|
||||
{
|
||||
allowSelected: false,
|
||||
iconname: 'page-number-bottom-center',
|
||||
data: {
|
||||
type: c_pageNumPosition.PAGE_NUM_POSITION_BOTTOM,
|
||||
|
@ -2122,7 +2120,6 @@ define([
|
|||
}
|
||||
},
|
||||
{
|
||||
allowSelected: false,
|
||||
iconname: 'page-number-bottom-right',
|
||||
data: {
|
||||
type: c_pageNumPosition.PAGE_NUM_POSITION_BOTTOM,
|
||||
|
@ -2133,6 +2130,7 @@ define([
|
|||
itemTemplate: _.template('<div id="<%= id %>" class="item-pagenumber options__icon options__icon-huge <%= iconname %>"></div>')
|
||||
});
|
||||
_conf && this.mnuPageNumberPosPicker.setDisabled(_conf.disabled);
|
||||
this.mnuInsertPageNum.menu.setInnerMenu([{menu: this.mnuPageNumberPosPicker, index: 0}]);
|
||||
|
||||
this.mnuTablePicker = new Common.UI.DimensionPicker({
|
||||
el: $('#id-toolbar-menu-tablepicker'),
|
||||
|
|
|
@ -3567,6 +3567,7 @@ define([
|
|||
view.paraBulletsPicker = new Common.UI.DataView({
|
||||
el : $('#id-docholder-menu-bullets'),
|
||||
parentMenu : view.menuParagraphBullets.menu,
|
||||
outerMenu: {menu: view.menuParagraphBullets.menu, index: 0},
|
||||
groups : view.paraBulletsPicker.groups,
|
||||
store : view.paraBulletsPicker.store,
|
||||
itemTemplate: _.template('<% if (type==0) { %>' +
|
||||
|
@ -3576,6 +3577,7 @@ define([
|
|||
'<% } %>')
|
||||
});
|
||||
view.paraBulletsPicker.on('item:click', _.bind(this.onSelectBullets, this));
|
||||
view.menuParagraphBullets.menu.setInnerMenu([{menu: view.paraBulletsPicker, index: 0}]);
|
||||
_conf && view.paraBulletsPicker.selectRecord(_conf.rec, true);
|
||||
},
|
||||
|
||||
|
|
|
@ -664,11 +664,13 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
|
|||
var picker = new Common.UI.DataView({
|
||||
el: $('#format-rules-combo-menu-icon-' + (i+1)),
|
||||
parentMenu: menu,
|
||||
outerMenu: {menu: menu, index: 1},
|
||||
store: new Common.UI.DataViewStore(me.iconsList),
|
||||
itemTemplate: _.template('<img id="<%= id %>" class="item-icon" src="<%= imgUrl %>" style="width: 16px; height: 16px;">'),
|
||||
type : i
|
||||
});
|
||||
picker.on('item:click', _.bind(this.onSelectIcon, this, combo, menu.items[0]));
|
||||
menu.setInnerMenu([{menu: picker, index: 1}]);
|
||||
menu.items[0].on('toggle', _.bind(this.onSelectNoIcon, this, combo, picker));
|
||||
|
||||
this.iconsControls[i].cmbIcons = combo;
|
||||
|
|
Loading…
Reference in a new issue