src/aria/templates/TemplateCtxt.js
function (element) {
            if (element.tagName === "BODY" || !ariaUtilsDom.isInDom(element)) {
                return [];
            }
            var Ids = [];
            while (!element.__widget) {
                element = element.parentElement || element.parentNode; // Fx < 9 compat
            }
            var id = element.__widget.getId();
            if (!id) {
                return [];
            }
            Ids.unshift(id);
            var context = element.__widget._context;
            while (this !== context && context !== null) {
                id = context.getOriginalId();
                if (!id) {
                    return [];
                }
                Ids.unshift(id);
                context = context.parent;
            }
            if (context === null) {
                return [];
            }
            return Ids;
        }
function (element) {
            if (element.tagName === "BODY" || !ariaUtilsDom.isInDom(element)) {
                return [];
            }
            var Ids = [];
            while (!element.__widget) {
                element = element.parentElement || element.parentNode; // Fx < 9 compat
            }
            var id = element.__widget.getId();
            if (!id) {
                return [];
            }
            Ids.unshift(id);
            var context = element.__widget._context;
            while (this !== context && context !== null) {
                id = context.getOriginalId();
                if (!id) {
                    return [];
                }
                Ids.unshift(id);
                context = context.parent;
            }
            if (context === null) {
                return [];
            }
            return Ids;
        }
function ( element ) { if ( element . tagName === "BODY" || ! ariaUtilsDom . isInDom ( element ) ) { return [ ] ; } var Ids = [ ] ; while ( ! element . __widget ) { element = element . parentElement || element . parentNode ; // Fx < 9 compat } var id = element . __widget . getId ( ) ; if ( ! id ) { return [ ] ; } Ids . unshift ( id ) ; var context = element . __widget . _context ; while ( this !== context && context !== null ) { id = context . getOriginalId ( ) ; if ( ! id ) { return [ ] ; } Ids . unshift ( id ) ; context = context . parent ; } if ( context === null ) { return [ ] ; } return Ids ; }
Tries to find the widget id based on an HTML element, if no id can be found then null is returned.
@param {HTMLElement} element which is a part of a widget that the id needs to be retrieved for.
@return {Array} contains ids for the widget and templates that make the focused widget path.
Tries to find the widget id based on an HTML element if no id can be found then null is returned .