diff --git a/scripts/grid.js b/scripts/grid.js index cda0117..3826e06 100644 --- a/scripts/grid.js +++ b/scripts/grid.js @@ -58,6 +58,10 @@ class Grid { }); return r; } + + getArrTile() { + return this.pArrTile; + } } function updateTileCounts() { diff --git a/scripts/tile.js b/scripts/tile.js index b0094bc..5a37ffb 100644 --- a/scripts/tile.js +++ b/scripts/tile.js @@ -8,6 +8,8 @@ function Tile(obj, gridInstance) { pGrid.addTile(this); var pToolbar = null; + var pETV = null; + var pVoteFees = 0; var pVoteNoFees = 0; var pVoteOwn = null; @@ -69,6 +71,14 @@ function Tile(obj, gridInstance) { return pToolbar; }; + this.setETV = function (etv) { + pETV = etv; + }; + + this.getETV = function () { + return pETV; + }; + this.setVotes = function (no, yes, own) { pVoteFees = yes; pVoteNoFees = no; diff --git a/scripts/toolbar.js b/scripts/toolbar.js index 7a1baa9..7bb6231 100644 --- a/scripts/toolbar.js +++ b/scripts/toolbar.js @@ -254,6 +254,8 @@ class Toolbar { let context = $("#vh-toolbar-" + this.pTile.getAsin()); let span = $(context).find(".vh-toolbar-etv .etv"); + this.pTile.setETV(etv2); + if (onlyIfEmpty && span.text() != "") return false; etv1 = new Intl.NumberFormat(vineLocale, { @@ -412,7 +414,7 @@ class Toolbar { $(container).children(".vh-voting-widget").remove(); //Generate the HTML for the widget - prom = await Tpl.loadFile("view/widget_order.html"); + let prom = await Tpl.loadFile("view/widget_order.html"); Tpl.setVar("order_success", this.pTile.getOrderSuccess()); Tpl.setVar("order_failed", this.pTile.getOrderFailed()); Tpl.setIf("not-compact", !appSettings.unavailableTab.compactToolbar);