Fix for polymer 2 and remove unused methods Change-Id: Ic9706fa96ac52ad0b76d03db76f60ae4ace2414d
diff --git a/src/main/resources/static/find-owners.js b/src/main/resources/static/find-owners.js index db4ca99..6bbf747 100644 --- a/src/main/resources/static/find-owners.js +++ b/src/main/resources/static/find-owners.js
@@ -120,22 +120,6 @@ function getElement(id) { return document.getElementById(id); } - function httpGet(url, callback) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url); - xhr.onreadystatechange = function() { - if (xhr.readyState == XMLHttpRequest.DONE) { - // skip special characters ")]}'\n" - callback(!!xhr.responseText ? - JSON.parse(xhr.responseText.substring(5)) : {}); - } - }; - xhr.send(); - } - function httpError(msg, callback) { - console.log('UNIMPLEMENTED: ' + msg); - callback(); - } function restApiGet(url, callback) { self.restApi().get('/../..' + url).then(callback); } @@ -545,14 +529,11 @@ function callServer(callBack) { // Use the plugin REST API; pass only changeId; // let server get current patch set, project and branch info. - restApiGet('/changes/' + changeId + '/owners', showFindOwnersResults); + restApiGet('/changes/' + changeId + '/owners', callBack); } - event.stopPropagation(); + callServer(showFindOwnersResults); } - function onFindOwners(context) { - popupFindOwnersPage(context, context.change, context.revision, false); - } function onSubmit(change, revision) { const OWNER_REVIEW_LABEL = 'Owner-Review-Vote'; if (change.labels.hasOwnProperty(OWNER_REVIEW_LABEL)) { @@ -575,7 +556,11 @@ changeActions.setIcon(actionKey, 'robot'); changeActions.setTitle(actionKey, 'Find owners of changed files'); changeActions.addTapListener(actionKey, - () => popupFindOwnersPage(null, change, revision, false)); + (e) => { + if (e) e.stopPropagation(); + + popupFindOwnersPage(null, change, revision, false); + }); } function onClick(event) { if (pageDiv.style.visibility != 'hidden' && !useContextPopup) {