Make sure quotabox is there before using it

This commit is contained in:
Nathan Gray 2014-04-02 20:20:49 +00:00
parent d81adb1d82
commit 464c0f27fb

View File

@ -794,11 +794,15 @@ app.classes.mail = AppJS.extend(
{ {
//this.et2 should do the same as etemplate2.getByApplication('mail')[0].widgetContainer //this.et2 should do the same as etemplate2.getByApplication('mail')[0].widgetContainer
var quotabox = this.et2.getWidgetById(this.nm_index+'[quotainpercent]'); var quotabox = this.et2.getWidgetById(this.nm_index+'[quotainpercent]');
//console.log(_data,quotabox);
//try to set it via set_value and set label // Check to make sure it's there
this.et2.getWidgetById(this.nm_index+'[quotainpercent]').set_class(_data.data.quotaclass); if(quotabox)
this.et2.getWidgetById(this.nm_index+'[quotainpercent]').set_value(_data.data.quotainpercent); {
this.et2.getWidgetById(this.nm_index+'[quotainpercent]').set_label(_data.data.quota); //try to set it via set_value and set label
quotabox.set_class(_data.data.quotaclass);
quotabox.set_value(_data.data.quotainpercent);
quotabox.set_label(_data.data.quota);
}
}, },
/** /**