[FE] fix private image button is not stored correctly
This commit is contained in:
parent
0b241902a7
commit
203268252f
|
|
@ -58,7 +58,7 @@
|
||||||
Key</label>
|
Key</label>
|
||||||
<input type="password" class="form-control" id="apiKey" value="">
|
<input type="password" class="form-control" id="apiKey" value="">
|
||||||
<div class="input-group-text">
|
<div class="input-group-text">
|
||||||
<input class="form-check-input" type="checkbox" value="" id="isPrivate" value="">
|
<input class="form-check-input" type="checkbox" value="" id="isPrivate">
|
||||||
</div>
|
</div>
|
||||||
<label for="isPrivate" class="input-group-text" data-en_XX="Generate Private Images"
|
<label for="isPrivate" class="input-group-text" data-en_XX="Generate Private Images"
|
||||||
data-zh_CN="生成非公开图片">Generate Private Images</label>
|
data-zh_CN="生成非公开图片">Generate Private Images</label>
|
||||||
|
|
@ -593,12 +593,17 @@
|
||||||
var input = $(this);
|
var input = $(this);
|
||||||
var key = input.attr('id');
|
var key = input.attr('id');
|
||||||
var value = input.val();
|
var value = input.val();
|
||||||
|
if (input.attr('type') == "checkbox") {
|
||||||
|
value = input.is(":checked");
|
||||||
|
}
|
||||||
localStorage.setItem(key, value);
|
localStorage.setItem(key, value);
|
||||||
}).each(function () {
|
}).each(function () {
|
||||||
var input = $(this);
|
var input = $(this);
|
||||||
var key = input.attr('id');
|
var key = input.attr('id');
|
||||||
var value = localStorage.getItem(key);
|
var value = localStorage.getItem(key);
|
||||||
if (value) {
|
if (input.attr('type') == "checkbox") {
|
||||||
|
input.prop('checked', value == "true");
|
||||||
|
} else if (value) {
|
||||||
input.val(value);
|
input.val(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue