Browse Source

Move function def to correct place.

master
Ben Kurtovic 10 years ago
parent
commit
e76a2d0b7a
1 changed files with 16 additions and 16 deletions
  1. +16
    -16
      main.js

+ 16
- 16
main.js View File

@@ -75,6 +75,22 @@ function load_score_into_element(data, anime_id, elem) {
}
}

function update_shared_row_colors(row, our_pos) {
var our_cell = $(row.find("td")[our_pos]);
var their_cell = $(row.find("td")[our_pos == 1 ? 2 : 1]);
var diff = our_cell.text() - their_cell.text();

if (!diff) {
row.find("td").css("background-color", "#f6f6f6");
our_cell.add(their_cell).find("span").css("color", "");
}
else {
row.find("td").css("background-color", "");
our_cell.css("color", diff > 0 ? "#FF0000" : "#0000FF");
their_cell.css("color", diff > 0 ? "#0000FF" : "#FF0000");
}
}

/* --------------------------- Storage functions --------------------------- */

function save_score(anime_id, score) {
@@ -422,22 +438,6 @@ function hook_edit(anime_id) {
});
}

function update_shared_row_colors(row, our_pos) {
var our_cell = $(row.find("td")[our_pos]);
var their_cell = $(row.find("td")[our_pos == 1 ? 2 : 1]);
var diff = our_cell.text() - their_cell.text();

if (!diff) {
row.find("td").css("background-color", "#f6f6f6");
our_cell.add(their_cell).find("span").css("color", "");
}
else {
row.find("td").css("background-color", "");
our_cell.css("color", diff > 0 ? "#FF0000" : "#0000FF");
their_cell.css("color", diff > 0 ? "#0000FF" : "#FF0000");
}
}

function hook_shared() {
var our_profile = $("#nav a:first").attr("href"), our_pos;
var profile_links = $("#content h2:first").find("a").slice(1);


Loading…
Cancel
Save