download receiver details via rest api

This commit is contained in:
Jakob Ketterl
2020-05-10 17:27:46 +02:00
parent 11cf2a96e2
commit 8df885b727
4 changed files with 33 additions and 19 deletions

View File

@ -6,6 +6,7 @@ function Header(el) {
});
this.init_rx_photo();
this.download_details();
};
Header.prototype.setDetails = function(details) {
@ -57,6 +58,13 @@ Header.prototype.toggle_rx_photo = function(ev) {
}
};
Header.prototype.download_details = function() {
var self = this;
$.ajax('api/receiverdetails').done(function(data){
self.setDetails(data);
});
};
$.fn.header = function() {
if (!this.data('header')) {
this.data('header', new Header(this));