Permalink
Browse files

Merge branch 'MDL-37397-m24' of git://github.com/andrewnicols/moodle …

…into MOODLE_24_STABLE
  • Loading branch information...
2 parents 7c2046b + 283f877 commit 80b6e318fbb4ba21846dc15c173f46624b7e6343 Sam Hemelryk committed Jan 13, 2013
Showing with 11 additions and 3 deletions.
  1. +11 −3 lib/yui/formautosubmit/formautosubmit.js
@@ -40,9 +40,17 @@ YUI.add('moodle-core-formautosubmit',
}
// Assign this select items 'nothing' value and lastindex (current value)
- var thisselect = Y.one('select#' + this.get('selectid'));
- thisselect.setData('nothing', this.get('nothing'));
- thisselect.setData('startindex', thisselect.get('selectedIndex'));
+ if (this.get('selectid')) {
+ var thisselect = Y.one('select#' + this.get('selectid'));
+ if (thisselect) {
+ if (this.get('nothing')) {
+ thisselect.setData('nothing', this.get('nothing'));
+ }
+ thisselect.setData('startindex', thisselect.get('selectedIndex'));
+ } else {
+ Y.log("Warning: A single_select element was renderered, but the output is not displayed on the page.");
+ }
+ }
},
/**

0 comments on commit 80b6e31

Please sign in to comment.