Skip to content

Commit

Permalink
Improved access to ETV from the Tile object.
Browse files Browse the repository at this point in the history
Fixed but affecting Brave browser were prom was not properly defined in the toolbar.js file.
  • Loading branch information
FMaz008 committed Jun 19, 2024
1 parent 943fab3 commit 344faa9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions scripts/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class Grid {
});
return r;
}

getArrTile() {
return this.pArrTile;
}
}

function updateTileCounts() {
Expand Down
10 changes: 10 additions & 0 deletions scripts/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion scripts/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 344faa9

Please sign in to comment.