mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Removed some more readonly-related code.
This commit is contained in:
@@ -118,16 +118,11 @@ var pluginCardProto = Object.create(HTMLElement.prototype, {
|
||||
if (evt.target.className.indexOf('accept') != -1) {
|
||||
/* First validate table inputs. */
|
||||
var inputs = evt.target.parentElement.parentElement.getElementsByTagName('input');
|
||||
/* If an input is readonly, it doesn't validate, so check required / value length explicitly.
|
||||
/* If an input is readonly, it doesn't validate, but that's ok
|
||||
because the read-only inputs must be valid.
|
||||
*/
|
||||
for (var i = 0; i < inputs.length; ++i) {
|
||||
if (inputs[i].readOnly) {
|
||||
if (inputs[i].required && inputs[i].value.length == 0) {
|
||||
isValid = false;
|
||||
console.log(inputs[i]);
|
||||
inputs[i].readOnly = false;
|
||||
}
|
||||
} else if (!inputs[i].checkValidity()) {
|
||||
if (!inputs[i].checkValidity()) {
|
||||
isValid = false;
|
||||
console.log(inputs[i]);
|
||||
}
|
||||
|
||||
@@ -272,16 +272,11 @@ function handlePluginDragOver(evt) {
|
||||
function areSettingsValid() {
|
||||
/* First validate table inputs. */
|
||||
var inputs = document.getElementById('settings').getElementsByTagName('input');
|
||||
/* If an input is readonly, it doesn't validate, so check required / value length explicitly.
|
||||
/* If an input is readonly, it doesn't validate, but that's ok because the
|
||||
read-only inputs must be valid.
|
||||
*/
|
||||
for (var i = 0; i < inputs.length; ++i) {
|
||||
if (inputs[i].readOnly) {
|
||||
if (inputs[i].required && inputs[i].value.length == 0) {
|
||||
return false;
|
||||
console.log(inputs[i]);
|
||||
inputs[i].readOnly = false;
|
||||
}
|
||||
} else if (!inputs[i].checkValidity()) {
|
||||
if (!inputs[i].checkValidity()) {
|
||||
return false;
|
||||
console.log(inputs[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user