From 25d225ec9773431b6b71c654f91d063f44909a48 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Sat, 21 Sep 2013 00:25:00 -0500 Subject: [PATCH] Improve poll feedback --- changelog | 4 ++++ www/assets/css/ytsync.css | 13 +++++++++++++ www/assets/js/callbacks.js | 17 +++++++++-------- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/changelog b/changelog index 56770ae1..248c9dfb 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,7 @@ +Sat Sep 21 00:23 2013 CDT + * www/assets/js/callbacks.js, www/assets/css/ytsync.css: make it more + obvious which option was voted for + Sat Sep 21 00:08 2013 CDT * lib/playlist.js: Make .clean(filter) an instance method * lib/chatcommand.js: Make a few minor changes to unbibium's /clean diff --git a/www/assets/css/ytsync.css b/www/assets/css/ytsync.css index 424aabf5..0d74151e 100644 --- a/www/assets/css/ytsync.css +++ b/www/assets/css/ytsync.css @@ -247,10 +247,23 @@ body { font-size: 14pt; } +.option { + margin-top: 3px; +} + .option button { margin-right: 15px; } +.option-selected { + font-weight: bold; +} + +.option-selected button{ + border-width: 3px!important; + margin-right: 10px; +} + .nick-highlight { background-color: #ddffdd; } diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index 4c3fc071..65ec4248 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -996,13 +996,14 @@ Callbacks = { $("

").text(data.title).appendTo(poll); for(var i = 0; i < data.options.length; i++) { (function(i) { - var callback = function() { - socket.emit("vote", { - option: i - }); - poll.find(".option button").each(function() { - $(this).attr("disabled", "disabled"); - }); + var callback = function () { + socket.emit("vote", { + option: i + }); + poll.find(".option button").each(function() { + $(this).attr("disabled", "disabled"); + }); + $(this).parent().addClass("option-selected"); } $("