Merge branch 'MDL-33649-master-2' of git://git.luns.net.uk/moodle
authorAparup Banerjee <aparup@moodle.com>
Wed, 20 Jun 2012 07:19:18 +0000 (15:19 +0800)
committerAparup Banerjee <aparup@moodle.com>
Wed, 20 Jun 2012 07:19:18 +0000 (15:19 +0800)
1  2 
lib/yui/chooserdialogue/chooserdialogue.js

@@@ -66,20 -68,16 +69,28 @@@ YUI.add('moodle-core-chooserdialogue', 
              var bb = this.overlay.get('boundingBox');
              var dialogue = this.container.one('.alloptions');
  
+             // Get the overflow setting when the chooser was opened - we
+             // may need this later
+             if (Y.UA.ie > 0) {
+                 this.initialoverflow = Y.one('html').getStyle('overflow');
+             } else {
+                 this.initialoverflow = Y.one('body').getStyle('overflow');
+             }
              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);