Fix expand_multiple_rows button to only be added once

This commit is contained in:
Nathan Gray 2014-03-25 15:20:05 +00:00
parent 8954da4956
commit 7ef65b30d6

View File

@ -148,6 +148,8 @@ var et2_selectbox = et2_inputWidget.extend(
if(this.expand_button)
{
this.expand_button.off();
this.expand_button.remove();
this.expand_button = null;
}
this._super.apply(this, arguments);
@ -621,6 +623,8 @@ var et2_selectbox = et2_inputWidget.extend(
surroundings.removeDOMNode(this.expand_button.get(0));
}
else
{
if (!this.expand_button)
{
var button_id = this.getInstanceManager().uniqueId+'_'+this.id.replace(/\./g, '-') + "_expand";
this.expand_button = $j("<button class='et2_button et2_button_icon et2_selectbox_expand' id='" + button_id + "'/>")
@ -634,6 +638,7 @@ var et2_selectbox = et2_inputWidget.extend(
this.set_multiple(true, this.options.expand_multiple_rows);
}
},this));
}
surroundings.appendDOMNode(this.expand_button.get(0));
}
surroundings.update();