diff --git a/src/jsds.js b/src/jsds.js index 2b416c1..f31d664 100644 --- a/src/jsds.js +++ b/src/jsds.js @@ -298,40 +298,26 @@ sel_bon: function() { var outstr="

"; outstr += "Boni?
"; - outstr += "Waffenbonus Nahkampf:
"; - outstr += "Waffenbonus Fernkampf:
"; - outstr += "Panzerungsbonus:
"; - outstr += "Zauberbonus:
"; + outstr += "Waffenbonus Nahkampf:
"; + outstr += "Waffenbonus Fernkampf:
"; + outstr += "Panzerungsbonus:
"; + outstr += "Zauberbonus:
"; $('#uibon').html(outstr); - $('#wbn').attr("value", cur_sel.extern.weapon_near+"") - .bind("change", - function() {cur_sel.extern.weapon_near = this.value*1; - cur_sel.recalc_battle(); - cur_sel.printoutput(); - } - ); - $('#wbf').attr("value", cur_sel.extern.weapon_far) - .bind("change", - function() {cur_sel.extern.weapon_far = this.value*1; - cur_sel.recalc_battle(); - cur_sel.printoutput(); - } - ); - $('#pb').attr("value",cur_sel.extern.armor) - .bind("change", - function() {cur_sel.extern.armor = this.value*1; - cur_sel.recalc_battle(); - cur_sel.printoutput(); - } - ); - $('#zb').attr("value",cur_sel.extern.chant) - .bind("change", - function() {cur_sel.extern.chant = this.value*1; - cur_sel.recalc_battle(); - cur_sel.printoutput(); - } - ); + $('.bon').bind("change", function() { + cur_sel.extern.weapon_near = $('#wbn').val()*1; + cur_sel.extern.weapon_far = $('#wbf').val()*1; + cur_sel.extern.armor = $('#pb').val()*1; + cur_sel.extern.chant = $('#zb').val()*1; + cur_sel.recalc_battle(); + cur_sel.sel_att(); + cur_sel.printoutput(); + }); + + $('#wbn').attr("value", cur_sel.extern.weapon_near+""); + $('#wbf').attr("value", cur_sel.extern.weapon_far); + $('#pb').attr("value",cur_sel.extern.armor); + $('#zb').attr("value",cur_sel.extern.chant); }, printoutput: function() { outstr = "

";