Skip to content

Commit

Permalink
MDL-71671 atto_table: Insert menus html after the button
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaies committed Sep 7, 2021
1 parent 1e47c53 commit aa49eeb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Loading

0 comments on commit aa49eeb

Please sign in to comment.