Example #1
0
        /// <summary>
        /// Initializes the container's DOM when the container enters the document.
        /// Called from {@link goog.ui.Container#enterDocument}.
        /// </summary>
        /// <param name="container">Container whose DOM is to be initialized</param>
        ///     as it enters the document.
        public void initializeDom(goog.ui.Container container)
        {
            var elem = container.getElement();

            goog.asserts.assert(elem != null, "The container DOM element cannot be null.");
            // Make sure the container's element isn't selectable.  On Gecko, recursively
            // marking each child element unselectable is expensive and unnecessary, so
            // only mark the root element unselectable.
            goog.style.setUnselectable(elem, true, goog.userAgent.GECKO);

            // IE doesn't support outline:none, so we have to use the hideFocus property.
            if (goog.userAgent.IE)
            {
                elem.HideFocus = true;
            }

            // Set the ARIA role.
            var ariaRole = this.getAriaRole();

            if (ariaRole != 0)
            {
                goog.a11y.aria.setRole(elem, ariaRole);
            }
        }
Example #2
0
 /// <summary>
 /// </summary>
 /// Returns the element within the container's DOM that should receive keyboard
 /// focus (null if none).  The default implementation returns the container"s
 /// root element.
 /// <param name="container">Container whose key event target is</param>
 ///     to be returned.
 /// <returns>Key event target (null if none).</returns>
 public HTMLElement getKeyEventTarget(goog.ui.Container container)
 {
     return(container.getElement());
 }