Removed some more readonly-related code.

This commit is contained in:
WrinklyNinja
2014-07-21 11:22:06 +01:00
parent 18e4e024dc
commit c95a0835a7
2 changed files with 6 additions and 16 deletions
+3 -8
View File
@@ -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]);
}
+3 -8
View File
@@ -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]);
}