Skip to content

Commit

Permalink
#16 共通ファイルに書くと動作しない問題を解決
Browse files Browse the repository at this point in the history
  • Loading branch information
8398a7 committed Feb 13, 2015
1 parent f01d0de commit 576c75a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 deletions.
11 changes: 0 additions & 11 deletions app/assets/javascripts/recommends.js.coffee

This file was deleted.

14 changes: 13 additions & 1 deletion app/views/recommends/integration.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ h2
table.table
thead
th.center TITLE
th VALUE
th.center VALUE
tbody
- @sheets.each do |sheet|
- val = [sheet.e, sheet.c, sheet.h, sheet.exh, sheet.fc, sheet.aaa]
Expand All @@ -23,6 +23,18 @@ table.table
tr
td.center = sheet.title
td.center bgcolor=@color[0] = val[4]
coffee:
$.extend $.fn.DataTable.ext.oSort,
'custom': (a) ->
a
'custom-asc': (x, y) ->
x = parseFloat(x)
y = parseFloat(y)
if x < y then -1 else if x > y then 1 else 0
'custom-desc': (x, y) ->
x = parseFloat(x)
y = parseFloat(y)
if x < y then 1 else if x > y then -1 else 0
javascript:
(function() {
$('.table').dataTable({
Expand Down
12 changes: 12 additions & 0 deletions app/views/recommends/list.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ table.table
td.center bgcolor=@color[1] = val[3]
td.center bgcolor=@color[0] = val[4]
td.center = val[5]
coffee:
$.extend $.fn.DataTable.ext.oSort,
'custom': (a) ->
a
'custom-asc': (x, y) ->
x = parseFloat(x)
y = parseFloat(y)
if x < y then -1 else if x > y then 1 else 0
'custom-desc': (x, y) ->
x = parseFloat(x)
y = parseFloat(y)
if x < y then 1 else if x > y then -1 else 0
javascript:
$(document).ready(function() {
$('.table').dataTable({
Expand Down
12 changes: 12 additions & 0 deletions app/views/sheets/power.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ table.table
td.center bgcolor=@color[sheet.id] = val[3]
td.center bgcolor=@color[sheet.id] = val[4]
td.center = val[5]
coffee:
$.extend $.fn.DataTable.ext.oSort,
'custom': (a) ->
a
'custom-asc': (x, y) ->
x = parseFloat(x)
y = parseFloat(y)
if x < y then -1 else if x > y then 1 else 0
'custom-desc': (x, y) ->
x = parseFloat(x)
y = parseFloat(y)
if x < y then 1 else if x > y then -1 else 0
javascript:
(function() {
$('.table').dataTable({
Expand Down

0 comments on commit 576c75a

Please sign in to comment.