Better handling for detached label, fixes errors if there is no label

This commit is contained in:
Nathan Gray 2014-05-12 22:16:05 +00:00
parent b4b1eee57a
commit 777e1bec1e
2 changed files with 8 additions and 1 deletions

View File

@ -788,7 +788,7 @@ class nextmatch_widget
if($none_option)
{
array_unshift($cats, array(
'id' => '',
'id' => $prefix.'',
'name' => 'None'
));
}

View File

@ -1325,6 +1325,13 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM],
* passed to the "setDetachedAttributes" function in the same order.
*/
getDetachedNodes: function() {
// Create the label container if it didn't exist yet
if (this._labelContainer == null)
{
this._labelContainer = $j(document.createElement("label"))
.addClass("et2_label");
this.getSurroundings().insertDOMNode(this._labelContainer[0]);
}
return [this.list[0], this._labelContainer[0]];
},