* VRFS-1871 and VRFS-1903 are both results of easydropdown dying if it has a select with no options. So I default an empty select to 1 option with content N/A

This commit is contained in:
Seth Call 2014-07-23 22:50:15 -05:00
parent 1ca709d945
commit d73cc3af2c
1 changed files with 7 additions and 0 deletions

View File

@ -37,11 +37,18 @@
self.id = domNode.id;
self.options = [];
self.$options = self.$select.find('option');
if(self.$options.length == 0) {
// easydropdown does not fully work with a select that has no options
var $defaultOption = $('<option val="">N/A</option>');
self.$select.append($defaultOption);
self.$options = self.$select.find('option');
}
self.isTouch = 'ontouchend' in document;
self.$select.removeClass(self.wrapperClass+' dropdown');
if(self.$select.is(':disabled')){
self.disabled = true;
};
if(self.$options.length){
self.$options.each(function(i){
var $option = $(this);