diff --git a/static/main.js b/static/main.js index 946ebd1..05868d4 100644 --- a/static/main.js +++ b/static/main.js @@ -33,8 +33,11 @@ $(function() { // Switch style immediately without reloading the page: $("#style-options form").submit(function() { - var style = $(this).find('input[type="submit"]').prop("value"); + var style = $(this).find('input[type="submit"]').data("style"); var stylesheet = "/static/styles/" + style + ".css"; $("#user-style").prop("href", stylesheet); + $("#style-options .cur").removeClass("cur").find(":submit") + .prop("disabled", false); + $(this).addClass("cur").find(":submit").prop("disabled", true); }); }); diff --git a/templates/_default.mako b/templates/_default.mako index 9aa0573..c8512b2 100644 --- a/templates/_default.mako +++ b/templates/_default.mako @@ -15,15 +15,10 @@ stitle = style.title() url = url_for('staticv', filename='images/style/{}.png'.format(style)) %> - % if style == cur_style: -
-
${stitle}
-
- % else: -
- -
- % endif +
+ +
% endfor