瀏覽代碼

Move function def to correct place.

master
Ben Kurtovic 10 年之前
父節點
當前提交
e76a2d0b7a
共有 1 個文件被更改,包括 16 次插入16 次删除
  1. +16
    -16
      main.js

+ 16
- 16
main.js 查看文件

@@ -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…
取消
儲存