Add ability to select existing file in VFS for custom field type filemanager

- Fix missing ID
This commit is contained in:
Nathan Gray 2015-09-09 17:02:35 +00:00
parent a44661fc52
commit cf333cbbfb

View File

@ -608,6 +608,13 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
cf = jQuery(document.createElement("td"))
.appendTo(row);
// Create upload widget
var widget = this.widgets[field_name] = et2_createWidget(attrs.type ? attrs.type : field.type, attrs, this);
// This controls where the widget is placed in the DOM
this.rows[attrs.id] = cf[0];
$j(widget.getDOMNode(widget)).css('vertical-align','top');
// Add a link to existing VFS file
var select_attrs = jQuery.extend({},
attrs,
@ -625,14 +632,7 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
// Do not store in the widgets list, one name for multiple widgets would cause problems
widget = et2_createWidget(select_attrs.type, select_attrs, this);
$j(widget.getDOMNode(widget)).css('vertical-align','top');
// Create upload widget
var widget = this.widgets[field_name] = et2_createWidget(attrs.type ? attrs.type : field.type, attrs, this);
// This controls where the widget is placed in the DOM
this.rows[attrs.id] = cf[0];
$j(widget.getDOMNode(widget)).css('vertical-align','top');
$j(widget.getDOMNode(widget)).css('vertical-align','top').prependTo(cf);
}
return false;
},