Permalink
Browse files

Upgrade scalachess and tweak filter UI

  • Loading branch information...
1 parent 639aebd commit d279d135b5a307fd8286a5d738c37453063371e7 @ornicar committed Dec 30, 2012
View
BIN public/images/s16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
17 public/javascripts/big.js
@@ -1510,7 +1510,7 @@ var lichess_translations = [];
var $newposts = $("div.new_posts");
var $newpostsinner = $newposts.find('.undertable_inner');
var $hooks = $wrap.find('div.hooks');
- var $hooksTable = $hooks.find("table");
+ var $hooksTable = $hooks.find("table").on('click', 'a.join', $.lichessOpeningPreventClicks);
var actionUrls = {
'cancel': $hooks.data('cancel-url'),
'join': $hooks.data('join-url')
@@ -1521,9 +1521,18 @@ var lichess_translations = [];
var hookOwnerId = $hooks.data('my-hook');
$wrap.find('a.filter').click(function() {
+ var $a = $(this);
+ var $div = $wrap.find('div.filter');
+ setTimeout(function() {
+ $div.click(function(e) { e.stopPropagation(); });
+ $('html').one('click', function(e) {
+ $div.off('click').fadeOut(200);
+ $a.removeClass('active');
+ });
+ }, 10);
$(this).toggleClass('active');
if($(this).hasClass('active')) {
- var $filter = $wrap.find('div.filter').fadeIn(200);
+ var $filter = $div.fadeIn(200);
if ($filter.is(':empty')) {
$.ajax({
url: $(this).attr('href'),
@@ -1551,7 +1560,7 @@ var lichess_translations = [];
});
}
} else {
- var $filter = $wrap.find('div.filter').fadeOut(200);
+ $div.fadeOut(200);
}
return false;
});
@@ -1705,7 +1714,7 @@ var lichess_translations = [];
$hooksTable.removeClass('empty_table').find('tr.create_game').remove();
}
resizeLobby();
- $hooksTable.find('a.join').click($.lichessOpeningPreventClicks);
+ $wrap.find('a.filter').toggleClass('on', filter.mode != null || filter.variant != null || filter.speed != null);
}
function renderHook(hook) {
View
8 public/stylesheets/dark.css
@@ -173,6 +173,14 @@ body.dark div.hooks_wrap a.filter {
border-color: #444;
color: #e0e0e0;
}
+body.dark div.hooks_wrap a.filter:hover,
+body.dark div.hooks_wrap a.filter.active {
+ background: #000;
+}
+body.dark div.hooks_wrap div.filter {
+ background-color: black;
+ border-color: #505050;
+}
body.dark div.undertable tr:nth-child(even) td
{
View
7 public/stylesheets/opening.css
@@ -114,6 +114,13 @@ div.hooks_wrap a.filter:hover,
div.hooks_wrap a.filter.active {
background: #fff;
}
+div.hooks_wrap a.filter.on {
+ padding: 0 10px 0 2px;
+}
+div.hooks_wrap a.filter.on span {
+ padding: 0 0 0 20px;
+ background-position: left -112px;
+}
div.hooks_wrap div.filter {
position: absolute;
display: none;
2 scalachess
@@ -1 +1 @@
-Subproject commit 4d26d867a26b02712ddc660fbd3ba703698a786c
+Subproject commit 2d62d298770fe05303e0116a20839441d90c793d

0 comments on commit d279d13

Please sign in to comment.