Changed the header toggles to instead use Roll20's automatic attr mirroring.

This commit is contained in:
kehofset@live.no
2018-02-17 18:43:05 +01:00
parent 9191f0a270
commit fc68c31e05
@@ -727,7 +727,7 @@
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle" name="attr_stats_show">
<label class="sheet-section-toggle-header-label">
<h3>Core Stats</h3>
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_stats_show_label">
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_stats_show">
</label>
<div class="sheet-3colrow sheet-stats sheet-section-hide">
<div class="sheet-col">
@@ -1003,7 +1003,7 @@
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle" name="attr_combat_show">
<label class="sheet-section-toggle-header-label">
<h3>Combat</h3>
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_combat_show_label">
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_combat_show">
</label>
<div class="sheet-section-hide">
<div class="sheet-row">
@@ -1063,7 +1063,7 @@
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle" name="attr_saves_show">
<label class="sheet-section-toggle-header-label">
<h3>Saving Throws</h3>
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_saves_show_label">
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_saves_show">
</label>
<div class="sheet-section-hide">
<div class="sheet-3colrow sheet-saves">
@@ -1095,7 +1095,7 @@
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle" name="attr_skills_show">
<label class="sheet-section-toggle-header-label">
<h3>Skills</h3>
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_skills_show_label">
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_skills_show">
</label>
<div class="sheet-section-hide">
<div class="sheet-2colrow sheet-skills">
@@ -1555,7 +1555,7 @@
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle" name="attr_psionics_show">
<label class="sheet-section-toggle-header-label">
<h3>Psychic Skills and Techniques</h3>
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_psionics_show_label">
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_psionics_show">
</label>
<div class="sheet-section-hide">
<div class="sheet-2colrow sheet-skills sheet-hide">
@@ -1677,7 +1677,7 @@
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle" name="attr_foci_show">
<label class="sheet-section-toggle-header-label">
<h3>Foci</h3>
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_foci_show_label">
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_foci_show">
</label>
<div class="sheet-row sheet-section-hide">
<fieldset class="repeating_foci">
@@ -1697,7 +1697,7 @@
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle" name="attr_gear_show">
<label class="sheet-section-toggle-header-label">
<h3>Gear</h3>
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_gear_show_label">
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_gear_show">
</label>
<div class="sheet-section-hide">
<div class="sheet-row">
@@ -1876,7 +1876,7 @@
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle" name="attr_misc_show">
<label class="sheet-section-toggle-header-label">
<h3>Miscellaneous</h3>
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_misc_show_label">
<input checked type="checkbox" title="show/hide" class="sheet-section-toggle-header" name="attr_misc_show">
</label>
<div class="sheet-section-hide">
<div class="sheet-2colrow">
@@ -2879,47 +2879,4 @@ fillNpc = function() {
});
}
/**
* Checkbox madness
*/
on("change:stats_show_label", function () {
getAttrs(['stats_show_label'], function(v) {
setAttrs({stats_show:v.stats_show_label});
});
});
on("change:combat_show_label", function () {
getAttrs(['combat_show_label'], function(v) {
setAttrs({combat_show:v.combat_show_label});
});
});
on("change:saves_show_label", function () {
getAttrs(['saves_show_label'], function(v) {
setAttrs({saves_show:v.saves_show_label});
});
});
on("change:skills_show_label", function () {
getAttrs(['skills_show_label'], function(v) {
setAttrs({skills_show:v.skills_show_label});
});
});
on("change:psionics_show_label", function () {
getAttrs(['psionics_show_label'], function(v) {
setAttrs({psionics_show:v.psionics_show_label});
});
});
on("change:foci_show_label", function () {
getAttrs(['foci_show_label'], function(v) {
setAttrs({foci_show:v.foci_show_label});
});
});
on("change:gear_show_label", function () {
getAttrs(['gear_show_label'], function(v) {
setAttrs({gear_show:v.gear_show_label});
});
});
on("change:misc_show_label", function () {
getAttrs(['misc_show_label'], function(v) {
setAttrs({misc_show:v.misc_show_label});
});
});
</script>