MDL-71671 atto_table: Insert menus html after the button

This commit is contained in:
Shamim Rezaie
2021-09-07 13:53:50 +10:00
parent 1e47c534a7
commit aa49eebd2a
4 changed files with 14 additions and 8 deletions
@@ -864,6 +864,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
e.preventDefault();
var boundingBox;
var creatorButton = this.buttons[this.name];
if (!this._contextMenu) {
this._menuOptions = [
@@ -915,9 +916,11 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
}
];
creatorButton.insert(Y.Node.create('<div class="menuplaceholder" id="' + buttonId + '_menu"></div>'), 'after');
this._contextMenu = new Y.M.editor_atto.Menu({
items: this._menuOptions,
buttonId: buttonId
buttonId: buttonId,
attachmentPoint: '#' + buttonId + '_menu'
});
// Add event handlers for table control menus.
@@ -938,7 +941,6 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
});
// Ensure that we focus on the button in the toolbar when we tab back to the menu.
var creatorButton = this.buttons[this.name];
this.get('host')._setTabFocus(creatorButton);
// Show the context menu, and align to the current position.
File diff suppressed because one or more lines are too long
@@ -864,6 +864,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
e.preventDefault();
var boundingBox;
var creatorButton = this.buttons[this.name];
if (!this._contextMenu) {
this._menuOptions = [
@@ -915,9 +916,11 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
}
];
creatorButton.insert(Y.Node.create('<div class="menuplaceholder" id="' + buttonId + '_menu"></div>'), 'after');
this._contextMenu = new Y.M.editor_atto.Menu({
items: this._menuOptions,
buttonId: buttonId
buttonId: buttonId,
attachmentPoint: '#' + buttonId + '_menu'
});
// Add event handlers for table control menus.
@@ -938,7 +941,6 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
});
// Ensure that we focus on the button in the toolbar when we tab back to the menu.
var creatorButton = this.buttons[this.name];
this.get('host')._setTabFocus(creatorButton);
// Show the context menu, and align to the current position.
+4 -2
View File
@@ -862,6 +862,7 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
e.preventDefault();
var boundingBox;
var creatorButton = this.buttons[this.name];
if (!this._contextMenu) {
this._menuOptions = [
@@ -913,9 +914,11 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
}
];
creatorButton.insert(Y.Node.create('<div class="menuplaceholder" id="' + buttonId + '_menu"></div>'), 'after');
this._contextMenu = new Y.M.editor_atto.Menu({
items: this._menuOptions,
buttonId: buttonId
buttonId: buttonId,
attachmentPoint: '#' + buttonId + '_menu'
});
// Add event handlers for table control menus.
@@ -936,7 +939,6 @@ Y.namespace('M.atto_table').Button = Y.Base.create('button', Y.M.editor_atto.Edi
});
// Ensure that we focus on the button in the toolbar when we tab back to the menu.
var creatorButton = this.buttons[this.name];
this.get('host')._setTabFocus(creatorButton);
// Show the context menu, and align to the current position.