Loading ...
Sorry, an error occurred while loading the content.
 

Weird behavior when render a Overlay Container in YUI 2.2.2

Expand Messages
  • jdgrieco
    When I add a overlay without a existent markup and don t set a body before render, this widget don t create the div.bd inside overlay element. See code above:
    Message 1 of 1 , Apr 27, 2007
      When I add a overlay without a existent markup and don't set a body
      before render, this widget don't create the div.bd inside overlay
      element. See code above:

      var fieldHint = new YAHOO.widget.Overlay('field-hint', {visible:
      false, constraintoviewport: true});
      fieldHint.render('main_body');

      var changeFocusHint = function (ev) {

      switch (ev.type) {
      case 'focus':
      YDom.addClass(this, 'focused');
      fieldHint.cfg.setProperty('context', [this, 'tl', 'tr']);
      fieldHint.setBody(this.id);
      fieldHint.show();
      break;

      case 'blur':
      YDom.removeClass(this, 'focused');
      fieldHint.hide();
      break;
      }
      }

      var forms = document.getElementsByTagName('FORM');
      if (forms.length > 0) {
      YDom.batch(forms, function (form) {
      for (var i = 0, length = form.elements.length; i < length;
      ++i) {
      var el = form.elements[i];
      switch (el.tagName) {
      case 'BUTTON':
      case 'FIELDSET':
      break;

      default:
      YEvent.on(el, 'focus', changeFocusHint);
      YEvent.on(el, 'blur', changeFocusHint);
      break;
      }
      }
      });
      }

      That's a bug?
    Your message has been successfully submitted and would be delivered to recipients shortly.