Skip to content
Browse files

MDL-33703 Adjust chooser location when changing browser orientation o…

…r size
  • Loading branch information...
1 parent 5e3698f commit baca9096318b9a231e395d86fbc73dff80787996 @andrewnicols andrewnicols committed Jun 13, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/yui/chooserdialogue/chooserdialogue.js
View
12 lib/yui/chooserdialogue/chooserdialogue.js
@@ -68,6 +68,18 @@ YUI.add('moodle-core-chooserdialogue', function(Y) {
var thisevent;
+ // This will detect a change in orientation and retrigger centering
+ thisevent = Y.one('document').on('orientationchange', function(e) {
+ this.center_dialogue(dialogue);
+ }, this);
+ this.listenevents.push(thisevent);
+
+ // Detect window resizes (most browsers)
+ thisevent = Y.one('window').on('resize', function(e) {
+ this.center_dialogue(dialogue);
+ }, this);
+ this.listenevents.push(thisevent);
+
// These will trigger a check_options call to display the correct help
thisevent = this.container.on('click', this.check_options, this);
this.listenevents.push(thisevent);

0 comments on commit baca909

Please sign in to comment.
Something went wrong with that request. Please try again.