From cfcafdf7e4699fcd2de96a0b2c4585b9b699bf45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Wed, 20 Jun 2012 22:33:57 +0200 Subject: [PATCH] Add sort direction --- index.php | 13 +++++++++++-- style.css | 6 ------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index f1f1194..370662b 100644 --- a/index.php +++ b/index.php @@ -45,7 +45,12 @@ $("#sort").click(function(){ $('.book').sortElements(function(a, b){ - return $(a).find ("." + $("#sortchoice").val()).text() > $(b).find ("." + $("#sortchoice").val()).text() ? 1 : -1; + var test = 1; + if ($("#sortorder").val() == "desc") + { + test = -1; + } + return $(a).find ("." + $("#sortchoice").val()).text() > $(b).find ("." + $("#sortchoice").val()).text() ? test : -test; }); $("#search").slideUp(); }); @@ -105,11 +110,15 @@
- + + Sort
diff --git a/style.css b/style.css index 455099a..aec38d9 100644 --- a/style.css +++ b/style.css @@ -220,12 +220,6 @@ vertical-align: middle; width: 242px; } -.search select -{ -width: 248px; -} - - .bookpopup { min-width: 400px;