Skip to content
Permalink
Browse files

MDL-10408 - added checks for propertyIsEnumerable for MooTools compat…

…ibility
  • Loading branch information...
urs_hunkler
urs_hunkler committed Aug 5, 2007
1 parent 48bfa2e commit d63ef3b83ba010ec68bda600cd18082716c995b3
Showing with 19 additions and 3 deletions.
  1. +19 −3 lib/javascript-static.js
@@ -88,8 +88,12 @@ function lockoptionsall(formid) {
var dependons = eval(formid+'items');
var tolock = Array();
for (var dependon in dependons) {
// change for MooTools compatibility
if (!dependons.propertyIsEnumerable(dependon)) {
continue;
}
var master = form[dependon];
if (master == undefined) {
if (master === undefined) {
continue;
}
for (var condition in dependons[dependon]) {
@@ -108,6 +112,10 @@ function lockoptionsall(formid) {
lock = master.value!=value; break;
}
for (var ei in dependons[dependon][condition][value]) {
// change for MooTools compatibility
if (!window.webkit && (!dependons[dependon][condition][value].propertyIsEnumerable(ei))) {
continue;
}
var eltolock = dependons[dependon][condition][value][ei];
if (tolock[eltolock] != null){
tolock[eltolock] =
@@ -120,8 +128,12 @@ function lockoptionsall(formid) {
}
}
for (var el in tolock){
// change for MooTools compatibility
if (!tolock.propertyIsEnumerable(el)) {
continue;
}
var formelement = form[el];
if (formelement == undefined) {
if ((formelement === undefined) || (formelement.disabled === undefined)) {
continue;
}
formelement.disabled = tolock[el];
@@ -133,8 +145,12 @@ function lockoptionsallsetup(formid) {
var form = document.forms[formid];
var dependons = eval(formid+'items');
for (var dependon in dependons) {
// change for MooTools compatibility
if (!dependons.propertyIsEnumerable(dependon)) {
continue;
}
var master = form[dependon];
if (master == undefined) {
if (master === undefined) {
continue;
}
master.formid = formid;

0 comments on commit d63ef3b

Please sign in to comment.
You can’t perform that action at this time.