microsoft / azure-devops-extension-sdk

Client SDK for developing Azure DevOps extensions
MIT License
123 stars 38 forks source link

Identity Picker doesn't work with modern versions of JQuery #14

Open davidcorrigan714 opened 5 years ago

davidcorrigan714 commented 5 years ago

The createImgElement function fails on a load call to JQuery. Here's the minified version:

davidcorrigan714 commented 5 years ago

Ooops, continuing on this comment ...

        n.createImgElement = function(n, t, i, r) {
            t === void 0 && (t = "");
            i === void 0 && (i = "");
            r === void 0 && (r = "");
            var u = $("<img>").css("background", "url('" + n + "') no-repeat").css("background-size", "100%").attr("src", t ? t : n).attr("alt", "").attr("draggable", "false").on("dragstart", function() {
                return !1
            });
            u.on("error", function() {
                u.attr("src") && u.attr("src") === n ? (u.off("error"),
                u.css("background-color", "#7d7d7d").css("background-size", "100%")) : u.attr("src", n)
            });
            return u.load(function() {
                u.attr("src") && u.attr("src") !== n && u.css("background-image", "none")
            }),
            i && u.addClass(i),
            r && u.attr("data-objectid", r),
            u
        }

It fails on 'return u.load(function() {'