Merge branch 'MDL-28235-23' of git://github.com/FMCorz/moodle into MOODLE_23_STABLE
authorDan Poltawski <dan@moodle.com>
Wed, 31 Oct 2012 05:42:23 +0000 (13:42 +0800)
committerDan Poltawski <dan@moodle.com>
Wed, 31 Oct 2012 05:42:23 +0000 (13:42 +0800)
1  2 
lib/javascript-static.js

diff --combined lib/javascript-static.js
@@@ -1374,42 -1374,6 +1374,42 @@@ function hide_item(itemid) 
      }
  }
  
 +M.util.help_popups = {
 +    setup : function(Y) {
 +        Y.one('body').delegate('click', this.open_popup, 'a.helplinkpopup', this);
 +    },
 +    open_popup : function(e) {
 +        // Prevent the default page action
 +        e.preventDefault();
 +
 +        // Grab the anchor that was clicked
 +        var anchor = e.target.ancestor('a', true);
 +        var args = {
 +            'name'          : 'popup',
 +            'url'           : anchor.getAttribute('href'),
 +            'options'       : ''
 +        };
 +        var options = [
 +            'height=600',
 +            'width=800',
 +            'top=0',
 +            'left=0',
 +            'menubar=0',
 +            'location=0',
 +            'scrollbars',
 +            'resizable',
 +            'toolbar',
 +            'status',
 +            'directories=0',
 +            'fullscreen=0',
 +            'dependent'
 +        ]
 +        args.options = options.join(',');
 +
 +        openpopup(e, args);
 +    }
 +}
 +
  M.util.help_icon = {
      Y : null,
      instance : null,
                      },
  
                      display : function(event, args) {
 +                        if (Y.one('html').get('dir') == 'rtl') {
 +                            var overlayPosition = [Y.WidgetPositionAlign.TR, Y.WidgetPositionAlign.LC];
 +                        } else {
 +                            var overlayPosition = [Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.RC];
 +                        }
 +
                          this.helplink = args.node;
 +
                          this.overlay.set('bodyContent', Y.Node.create('<img src="'+M.cfg.loadingicon+'" class="spinner" />'));
 -                        this.overlay.set("align", {node:args.node, points:[Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.RC]});
 +                        this.overlay.set("align", {node:args.node, points: overlayPosition});
  
                          var fullurl = args.url;
                          if (!args.url.match(/https?:\/\//)) {
  
                          Y.io(ajaxurl, cfg);
                          this.overlay.show();
-                         Y.one('#closehelpbox').focus();
                      },
  
                      display_callback : function(content) {