Merge branch 'MDL-71671-master' of git://github.com/rezaies/moodle

This commit is contained in:
Jun Pataleta 2021-09-07 14:55:13 +08:00
commit fec5a40ddb
15 changed files with 49 additions and 19 deletions

View File

@ -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

View File

@ -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.

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.

View File

@ -559,6 +559,8 @@ EditorPluginButtons.prototype = {
// Append it to the group.
group.append(button);
group.append(Y.Node.create('<div class="menuplaceholder" id="' + id + '_menu"></div>'));
config.attachmentPoint = '#' + id + '_menu';
currentFocus = this.toolbar.getAttribute('aria-activedescendant');
if (!currentFocus) {

File diff suppressed because one or more lines are too long

View File

@ -557,6 +557,8 @@ EditorPluginButtons.prototype = {
// Append it to the group.
group.append(button);
group.append(Y.Node.create('<div class="menuplaceholder" id="' + id + '_menu"></div>'));
config.attachmentPoint = '#' + id + '_menu';
currentFocus = this.toolbar.getAttribute('aria-activedescendant');
if (!currentFocus) {

View File

@ -409,6 +409,8 @@ EditorPluginButtons.prototype = {
// Append it to the group.
group.append(button);
group.append(Y.Node.create('<div class="menuplaceholder" id="' + id + '_menu"></div>'));
config.attachmentPoint = '#' + id + '_menu';
currentFocus = this.toolbar.getAttribute('aria-activedescendant');
if (!currentFocus) {

View File

@ -76,7 +76,8 @@ DIALOGUE = function(config) {
.append(Y.Node.create('<div class="' + CSS_CLASSES.HEADER + ' yui3-widget-hd"></div>'))
.append(Y.Node.create('<div class="' + CSS_CLASSES.BODY + ' yui3-widget-bd"></div>'))
.append(Y.Node.create('<div class="' + CSS_CLASSES.FOOTER + ' yui3-widget-ft"></div>')));
Y.one(document.body).append(config.notificationBase);
config.attachmentPoint = config.attachmentPoint || document.body;
Y.one(config.attachmentPoint).append(config.notificationBase);
config.srcNode = '#' + id;
delete config.buttons; // Don't let anyone pass in buttons as we want to control these during init. addButton can be used later.
DIALOGUE.superclass.constructor.apply(this, [config]);

File diff suppressed because one or more lines are too long

View File

@ -76,7 +76,8 @@ DIALOGUE = function(config) {
.append(Y.Node.create('<div class="' + CSS_CLASSES.HEADER + ' yui3-widget-hd"></div>'))
.append(Y.Node.create('<div class="' + CSS_CLASSES.BODY + ' yui3-widget-bd"></div>'))
.append(Y.Node.create('<div class="' + CSS_CLASSES.FOOTER + ' yui3-widget-ft"></div>')));
Y.one(document.body).append(config.notificationBase);
config.attachmentPoint = config.attachmentPoint || document.body;
Y.one(config.attachmentPoint).append(config.notificationBase);
config.srcNode = '#' + id;
delete config.buttons; // Don't let anyone pass in buttons as we want to control these during init. addButton can be used later.
DIALOGUE.superclass.constructor.apply(this, [config]);

View File

@ -46,7 +46,8 @@ DIALOGUE = function(config) {
.append(Y.Node.create('<div class="' + CSS_CLASSES.HEADER + ' yui3-widget-hd"></div>'))
.append(Y.Node.create('<div class="' + CSS_CLASSES.BODY + ' yui3-widget-bd"></div>'))
.append(Y.Node.create('<div class="' + CSS_CLASSES.FOOTER + ' yui3-widget-ft"></div>')));
Y.one(document.body).append(config.notificationBase);
config.attachmentPoint = config.attachmentPoint || document.body;
Y.one(config.attachmentPoint).append(config.notificationBase);
config.srcNode = '#' + id;
delete config.buttons; // Don't let anyone pass in buttons as we want to control these during init. addButton can be used later.
DIALOGUE.superclass.constructor.apply(this, [config]);

View File

@ -39,8 +39,15 @@ div.editor_atto_toolbar button {
cursor: pointer;
}
div.editor_atto_toolbar button + button {
border-left: 1px solid #ccc;
div.editor_atto_toolbar .menuplaceholder {
display: inline-block;
}
div.editor_atto_toolbar {
button + button,
.menuplaceholder + button {
border-left: 1px solid #ccc;
}
}
div.editor_atto_toolbar button[disabled] {

View File

@ -19652,7 +19652,11 @@ div.editor_atto_toolbar button {
border-radius: 0;
cursor: pointer; }
div.editor_atto_toolbar button + button {
div.editor_atto_toolbar .menuplaceholder {
display: inline-block; }
div.editor_atto_toolbar button + button,
div.editor_atto_toolbar .menuplaceholder + button {
border-left: 1px solid #ccc; }
div.editor_atto_toolbar button[disabled] {

View File

@ -19842,7 +19842,11 @@ div.editor_atto_toolbar button {
border-radius: 0;
cursor: pointer; }
div.editor_atto_toolbar button + button {
div.editor_atto_toolbar .menuplaceholder {
display: inline-block; }
div.editor_atto_toolbar button + button,
div.editor_atto_toolbar .menuplaceholder + button {
border-left: 1px solid #ccc; }
div.editor_atto_toolbar button[disabled] {