Skip to content

Commit

Permalink
MDL-44101 Javascript: Apply widget-focusonclose to some core dialogues
Browse files Browse the repository at this point in the history
Conflicts:
	lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js
  • Loading branch information
andrewnicols authored and Damyon Wiese committed Feb 24, 2014
1 parent 7ae6ce0 commit 29ee3cf
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, {
modal: true, // This dialogue should be modal.
shim : true,
closeButtonTitle : this.get('closeButtonTitle'),
focusOnPreviousTargetAfterHide: true,
render : false
};

Expand Down Expand Up @@ -155,7 +156,7 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, {
this.options.removeAttribute('disabled');

// Display the panel
this.panel.show();
this.panel.show(e);

// Re-centre the dialogue after we've shown it.
this.center_dialogue(dialogue);
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, {
modal: true, // This dialogue should be modal.
shim : true,
closeButtonTitle : this.get('closeButtonTitle'),
focusOnPreviousTargetAfterHide: true,
render : false
};

Expand Down Expand Up @@ -155,7 +156,7 @@ Y.extend(CHOOSERDIALOGUE, Y.Base, {
this.options.removeAttribute('disabled');

// Display the panel
this.panel.show();
this.panel.show(e);

// Re-centre the dialogue after we've shown it.
this.center_dialogue(dialogue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ Y.Base.modifyAttrs(DIALOGUE, {
}
});

Y.Base.mix(DIALOGUE, [Y.M.core.WidgetFocusAfterHide]);

M.core.dialogue = DIALOGUE;
/**
* A dialogue type designed to display informative messages to users.
Expand Down Expand Up @@ -648,4 +650,14 @@ M.core.notification = M.core.notification || {};
M.core.notification.info = INFO;


}, '@VERSION@', {"requires": ["base", "node", "panel", "event-key", "dd-plugin", "moodle-core-lockscroll"]});
}, '@VERSION@', {
"requires": [
"base",
"node",
"panel",
"event-key",
"dd-plugin",
"moodle-core-widget-focusafterclose",
"moodle-core-lockscroll"
]
});
Loading

0 comments on commit 29ee3cf

Please sign in to comment.