Convert gr-comment-api-mock to class-based element
Change-Id: If0ad1b84a6bc3c93578cab903986f295af5f0ec7
This commit is contained in:
@@ -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);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user