[feature] add accent randomise control to menu

This commit is contained in:
zombieFox 2019-02-23 14:20:58 +00:00
parent b375923d43
commit dc8fe2b459
2 changed files with 13 additions and 1 deletions

View File

@ -383,10 +383,13 @@
<input id="control-layout-theme-style-pastel" class="control-layout-theme-style-pastel" type="radio" name="control-layout-theme-style" value="pastel" tabindex="1"> <input id="control-layout-theme-style-pastel" class="control-layout-theme-style-pastel" type="radio" name="control-layout-theme-style" value="pastel" tabindex="1">
<label for="control-layout-theme-style-pastel"><span class="label-icon"></span>Pastel colours</label> <label for="control-layout-theme-style-pastel"><span class="label-icon"></span>Pastel colours</label>
</div> </div>
<div class="radio-wrap form-indent-1"> <div class="radio-wrap form-indent-1 mb-3">
<input id="control-layout-theme-style-saturated" class="control-layout-theme-style-saturated" type="radio" name="control-layout-theme-style" value="saturated" tabindex="1"> <input id="control-layout-theme-style-saturated" class="control-layout-theme-style-saturated" type="radio" name="control-layout-theme-style" value="saturated" tabindex="1">
<label for="control-layout-theme-style-saturated"><span class="label-icon"></span>Saturated colours</label> <label for="control-layout-theme-style-saturated"><span class="label-icon"></span>Saturated colours</label>
</div> </div>
<div class="button-wrap form-indent-1">
<button class="control-layout-theme-randomise" type="button">Randomise now</button>
</div>
</div> </div>
</div> </div>

View File

@ -491,6 +491,13 @@ var control = (function() {
func: function() { func: function() {
render(); render();
} }
}, {
element: helper.e(".control-layout-theme-randomise"),
type: "button",
func: function() {
theme.random();
theme.render();
}
}, { }, {
element: helper.e(".control-background-image-show"), element: helper.e(".control-background-image-show"),
path: "background.image.show", path: "background.image.show",
@ -856,10 +863,12 @@ var control = (function() {
if (state.get().layout.theme.random.active) { if (state.get().layout.theme.random.active) {
helper.eA("input[name='control-layout-theme-style']").forEach(function(arrayItem, index) { helper.eA("input[name='control-layout-theme-style']").forEach(function(arrayItem, index) {
arrayItem.disabled = false; arrayItem.disabled = false;
helper.e(".control-layout-theme-randomise").disabled = false;
}); });
} else { } else {
helper.eA("input[name='control-layout-theme-style']").forEach(function(arrayItem, index) { helper.eA("input[name='control-layout-theme-style']").forEach(function(arrayItem, index) {
arrayItem.disabled = true; arrayItem.disabled = true;
helper.e(".control-layout-theme-randomise").disabled = true;
}); });
}; };
}; };