Fix hide handler of cc, bcc expander in compose

This commit is contained in:
Hadi Nategh 2014-10-16 08:29:10 +00:00
parent c158a32c72
commit cb94c506d9

View File

@ -3623,20 +3623,39 @@ app.classes.mail = AppJS.extend(
/** /**
* Hide Folder, Cc and Bcc rows from the compose popup * Hide Folder, Cc and Bcc rows from the compose popup
* * -Only fields which have no content should get hidden
*/ */
compose_fieldExpander_hide: function () compose_fieldExpander_hide: function ()
{ {
var widgets = {cc:{},bcc:{},folder:{}}; var widgets = {
cc:{
widget:{},
jQClass: '.mailComposeJQueryCc'
},
bcc:{
widget:{},
jQClass: '.mailComposeJQueryBcc'
},
folder:{
widget:{},
jQClass: '.mailComposeJQueryFolder'
}};
for(var widget in widgets) for(var widget in widgets)
{ {
widgets[widget] = this.et2.getWidgetById(widget+'_expander'); var expanderBtn = widget + '_expander';
if (typeof widgets[widget] != 'undefined') widgets[widget].widget = this.et2.getWidgetById(widget);
// Add expander button widget to the widgets object
widgets[expanderBtn] = {widget:this.et2.getWidgetById(expanderBtn)};
if (typeof widgets[widget].widget != 'undefined'
&& typeof widgets[expanderBtn].widget != 'undefined'
&& widgets[widget].widget.get_value().length == 0)
{ {
widgets[widget].set_disabled(false); widgets[expanderBtn].widget.set_disabled(false);
jQuery(widgets[widget].jQClass).hide();
} }
} }
jQuery(".mailComposeJQueryCc,.mailComposeJQueryBcc,.mailComposeJQueryFolder").hide();
}, },
/** /**