Explorar el Código

Fix JS for previous commit.

master
Ben Kurtovic hace 8 años
padre
commit
6d8e8443b1
Se han modificado 2 ficheros con 8 adiciones y 10 borrados
  1. +4
    -1
      static/main.js
  2. +4
    -9
      templates/_default.mako

+ 4
- 1
static/main.js Ver fichero

@@ -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);
});
});

+ 4
- 9
templates/_default.mako Ver fichero

@@ -15,15 +15,10 @@
stitle = style.title()
url = url_for('staticv', filename='images/style/{}.png'.format(style))
%>
% if style == cur_style:
<div class="cur">
<div style="background-image: url('${url}')">${stitle}</div>
</div>
% else:
<form action="${url_for('set_style', style=style)}" method="post">
<input type="submit" title="${stitle}" value="${stitle}" style="background-image: url('${url}')">
</form>
% endif
<form action="${url_for('set_style', style=style)}" method="post"${' class="cur"' if style == cur_style else ''}>
<input type="submit" title="${stitle}" value="${stitle}" data-style="${style}"${' disabled' if style == cur_style else ''}
style="background-image: url('${url}')">
</form>
% endfor
</div>
</div>


Cargando…
Cancelar
Guardar