class HallscreenApp extends PassiveAuctionApp { constructor(config, helpers) { super(config, helpers); // cache some jquery selectors this.$lotno = $('#lotno'); this.$reg = $('#reg'); this.$manufacturer = $('#manufacturer'); this.$modelvariant = $('#modelvariant'); this.$lastbidsrc = $('#lastbidsrc'); this.$lastbidamount = $('#lastbidamount'); this.$datefirstreg = $('#datefirstreg'); this.$imageholder = $('#imageholder'); this.$overlay = $('#overlay'); this.overlaytimeout = null; this.lastOnlineBid = 0; } handleChangeLot(response) { this.wake(); var self = this; self.getLot( response.params.lotid, function(lot) { console.log(lot); self.$lotno.html(lot.auctionlot_lotnumber); self.$reg.html(lot.motorvehicle_registration); self.$manufacturer.html(lot.motorvehicle_manufacturer); self.$modelvariant.html([lot.motorvehicle_model, lot.motorvehicle_variant].join(' ')); self.$lastbidsrc.html('Waiting bid'); if(lot.auctionlot_saleprice) { self.$lastbidamount.html('£' + self.helpers.numberWithCommas(Math.round(lot.auctionlot_saleprice))); } else { self.$lastbidamount.html('£0'); } self.$datefirstreg.html(lot.motorvehicle_firstregistered); if(lot.motorvehicle_image) { //$('#imageholder').html(``); self.$imageholder.css({ 'background-image': `url('${lot.motorvehicle_image}')`, 'background-size': 'cover', 'background-position': 'center' }); } else { self.$imageholder.css({ 'background-image': 'none' }); } }, function() { console.log('Could not load lot.'); } ); this.hideOverlay(); this.lastOnlineBid = 0 } handleUpdateHallBid(response) { this.wake(); this.$lastbidsrc.html('Hall Bidder'); this.$lastbidamount.html(`£${this.helpers.numberWithCommas(Math.round(response.params.amount))}`); this.hideOverlay(); } handleBid(response) { this.wake(); var self = this; if(response.params.amount > this.lastOnlineBid) { this.lastOnlineBid = response.params.amount; var amount = this.helpers.numberWithCommas(Math.round(response.params.amount)); var content = [ `