Convert gr-comment-api-mock to class-based element

Change-Id: If0ad1b84a6bc3c93578cab903986f295af5f0ec7
This commit is contained in:
Dmitrii Filippov
2019-11-15 18:18:35 +01:00
parent 3fd2b102e1
commit 1bbb5fe64d

View File

@@ -17,16 +17,20 @@
(function() {
'use strict';
Polymer({
is: 'comment-api-mock',
class CommentApiMock extends Polymer.GestureEventListeners(
Polymer.LegacyElementMixin(
Polymer.Element)) {
static get is() { return 'comment-api-mock'; }
properties: {
_changeComments: Object,
},
static get properties() {
return {
_changeComments: Object,
};
}
loadComments() {
return this._reloadComments();
},
}
/**
* For the purposes of the mock, _reloadDrafts is not included because its
@@ -38,13 +42,15 @@
return this._reloadComments().then(() => {
return e.detail.resolve();
});
},
}
_reloadComments() {
return this.$.commentAPI.loadAll(this._changeNum)
.then(comments => {
this._changeComments = this.$.commentAPI._changeComments;
});
},
});
}
}
customElements.define(CommentApiMock.is, CommentApiMock);
})();