solved a little bug for the pushon and pushoff button

This commit is contained in:
squandor 2017-01-02 22:40:47 +01:00
parent 4b532e00fa
commit 1008c10be1
1 changed files with 10 additions and 5 deletions

View File

@ -95,11 +95,16 @@ $(document).ready(function() {
changeSwitch(this, {{v[0]}}); changeSwitch(this, {{v[0]}});
}); });
updateSwitches_block_{{count}}.push("{{v[0]}}"); updateSwitches_block_{{count}}.push("{{v[0]}}");
{% elif (v[1] == "pushon") or (v[1] == "pushoff") %} {% elif (v[1] == "pushon") %}
$('button[id="push_{{v[0]}}_block_{{count}}"]').click(function(e) { $('button[id="push_{{v[0]}}_block_{{count}}"]').click(function(e) {
e.preventDefault(); e.preventDefault();
changeSwitch(this, {{v[0]}}); changePush({{v[0]}}, 'on');
}); });
{% elif (v[1] == "pushoff") %}
$('button[id="push_{{v[0]}}_block_{{count}}"]').click(function(e) {
e.preventDefault();
changePush({{v[0]}}, 'off');
});
{% elif (v[1] == "setpoint") %} {% elif (v[1] == "setpoint") %}
updateSetpoints_block_{{count}}.push("{{v[0]}}"); updateSetpoints_block_{{count}}.push("{{v[0]}}");
{% elif (v[1] == "dimmer" or v[1] == "rgb") %} {% elif (v[1] == "dimmer" or v[1] == "rgb") %}