Skip to content

Commit f7946f9

Browse files
committed
use transition instead of animate, fixed addSolariBoard
1 parent 8ce3c5b commit f7946f9

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎js/solari.js‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ function ToUpper(code) {
8181
}
8282

8383
//constructs the solariBoard within the given div. If no parameter is given, adds the board to "body"
84-
function addSolariBoard() {
85-
$("body").append("<div id=\"solariBoardDiv\"></div>");
86-
addSolariBoard("solariBoardDiv");
87-
}
8884
function addSolariBoard(divSelector) {
8985
if (solari_setup_done === 1) {
9086
return;
9187
}
88+
89+
if (arguements.length === 0) {
90+
$("body").append("<div id=\"solariBoardDiv\"></div>");
91+
divSelector = "#solariBoardDiv";
92+
}
93+
9294
//The html structure of the solari board. This implementation is pretty ugly, but is a simple, single-append solution.
9395
var $solari = $("<div class=\"column solari_grid\">" +
9496
"<a id='show-solari' href=\"index.html\" onclick=\"localStorage['StopSolari']=0\">Show Solari Board</a>" +
@@ -284,7 +286,7 @@ function SpinIt(selector, num_spins, rate, pixel_distance, final_pos) {
284286
$(selector).css('backgroundPositionY', final_pos);
285287
};
286288
}
287-
$(selector).animate({backgroundPositionY: '+=' + (pixel_distance - 1)}, 1, f);
289+
$(selector).transition({backgroundPositionY: '+=' + (pixel_distance - 1)}, 1, f);
288290
}
289291
}
290292

@@ -364,7 +366,7 @@ function updateSolariBoard() {
364366
var next_due_row = solariData[i];
365367
time = next_due_row.sTime;
366368
var timeDelta = Date.parse(next_due_row.sDate).getTime() - new Date().getTime();
367-
var nOffset = Math.ceil(timeDelta / (1000 * 60 * 60 * 24)); //divide my miliseconds per day
369+
var nOffset = Math.ceil(timeDelta / (1000 * 60 * 60 * 24)); //divide by miliseconds per day
368370
var offset = (nOffset === 0 ? "" : nOffset.toString() + "d"); //hide if next due is today
369371
if(status_override) {
370372
if (time) {

0 commit comments

Comments
 (0)