Skip to content

Fixed a bug when render <tr> attribute in IE browser #99

@dcais

Description

@dcais
Tempo.exports.utils.getElement = function (template, html) {
    if (navigator.appVersion.indexOf("MSIE") > -1 && Tempo.exports.utils.equalsIgnoreCase(template.tagName, 'tr')) {
        // Wrapping to get around read-only innerHTML
        var el = window.document.createElement('div');
        el.innerHTML = '<table><tbody>' + html + '</tbody></table>';
        var depth = 3;
        while (depth--) {
            el = el.lastChild;
        }
        el.setAttribute('data-template', '');
        for (var a = 0; a < template.attributes.length; a++) {
            var attr = template.attributes[a];
            el.setAttribute(attr.name, attr.value);
        }

        return el;
    } else {
        //No need to wrap
        template.innerHTML = html;
        return template;
    }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions