Skip to content

Commit

Permalink
MDL-71672 atto_recordrtc: focus Atto button after hide
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaies committed Jul 19, 2021
1 parent c34bd1a commit 321c443
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 13 deletions.
Expand Up @@ -184,7 +184,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @private
*/
_audio: function() {
var dialogue = this.getDialogue();
var dialogue = this.getDialogue({
focusAfterHide: 'audio'
});

dialogue.set('headerContent', M.util.get_string('audiortc', 'atto_recordrtc'));
dialogue.set('bodyContent', this._createContent('audio'));
Expand All @@ -201,7 +203,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @private
*/
_video: function() {
var dialogue = this.getDialogue();
var dialogue = this.getDialogue({
focusAfterHide: 'video'
});

dialogue.set('headerContent', M.util.get_string('videortc', 'atto_recordrtc'));
dialogue.set('bodyContent', this._createContent('video'));
Expand Down Expand Up @@ -249,7 +253,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @param {Object} scope The "this" context of the editor.
*/
closeDialogue: function(scope) {
scope.getDialogue().hide();
scope.getDialogue().hide({
focusAfterHide: null
});

scope.editor.focus();
},
Expand All @@ -262,7 +268,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @param {string} annotation The HTML link to the recording.
*/
setLink: function(scope, annotation) {
scope.getDialogue().hide();
scope.getDialogue().hide({
focusAfterHide: null
});

scope.editor.focus();
scope.get('host').insertContentAtFocusPoint(annotation);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -184,7 +184,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @private
*/
_audio: function() {
var dialogue = this.getDialogue();
var dialogue = this.getDialogue({
focusAfterHide: 'audio'
});

dialogue.set('headerContent', M.util.get_string('audiortc', 'atto_recordrtc'));
dialogue.set('bodyContent', this._createContent('audio'));
Expand All @@ -201,7 +203,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @private
*/
_video: function() {
var dialogue = this.getDialogue();
var dialogue = this.getDialogue({
focusAfterHide: 'video'
});

dialogue.set('headerContent', M.util.get_string('videortc', 'atto_recordrtc'));
dialogue.set('bodyContent', this._createContent('video'));
Expand Down Expand Up @@ -249,7 +253,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @param {Object} scope The "this" context of the editor.
*/
closeDialogue: function(scope) {
scope.getDialogue().hide();
scope.getDialogue().hide({
focusAfterHide: null
});

scope.editor.focus();
},
Expand All @@ -262,7 +268,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @param {string} annotation The HTML link to the recording.
*/
setLink: function(scope, annotation) {
scope.getDialogue().hide();
scope.getDialogue().hide({
focusAfterHide: null
});

scope.editor.focus();
scope.get('host').insertContentAtFocusPoint(annotation);
Expand Down
16 changes: 12 additions & 4 deletions lib/editor/atto/plugins/recordrtc/yui/src/button/js/button.js
Expand Up @@ -182,7 +182,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @private
*/
_audio: function() {
var dialogue = this.getDialogue();
var dialogue = this.getDialogue({
focusAfterHide: 'audio'
});

dialogue.set('headerContent', M.util.get_string('audiortc', 'atto_recordrtc'));
dialogue.set('bodyContent', this._createContent('audio'));
Expand All @@ -199,7 +201,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @private
*/
_video: function() {
var dialogue = this.getDialogue();
var dialogue = this.getDialogue({
focusAfterHide: 'video'
});

dialogue.set('headerContent', M.util.get_string('videortc', 'atto_recordrtc'));
dialogue.set('bodyContent', this._createContent('video'));
Expand Down Expand Up @@ -247,7 +251,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @param {Object} scope The "this" context of the editor.
*/
closeDialogue: function(scope) {
scope.getDialogue().hide();
scope.getDialogue().hide({
focusAfterHide: null
});

scope.editor.focus();
},
Expand All @@ -260,7 +266,9 @@ Y.namespace('M.atto_recordrtc').Button = Y.Base.create('button', Y.M.editor_atto
* @param {string} annotation The HTML link to the recording.
*/
setLink: function(scope, annotation) {
scope.getDialogue().hide();
scope.getDialogue().hide({
focusAfterHide: null
});

scope.editor.focus();
scope.get('host').insertContentAtFocusPoint(annotation);
Expand Down

0 comments on commit 321c443

Please sign in to comment.