BUGFIX: fallback for changes in r98101, required if TreeDropdownField is used in a widgetarea, and does not know its field (from r98671)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102777 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-14 02:22:37 +00:00
parent 53d5a04655
commit deb038ad2f
2 changed files with 2 additions and 1 deletions

View File

@ -113,7 +113,7 @@ class TreeDropdownField extends FormField {
array (
'id' => "TreeDropdownField_{$this->id()}",
'class' => 'TreeDropdownField single' . ($this->extraClass() ? " {$this->extraClass()}" : ''),
'href' => $this->Link(),
'href' => $this->form ? $this->Link() : "",
),
$this->createTag (
'input',

View File

@ -60,6 +60,7 @@ TreeDropdownField.prototype = {
// Build a URL from the field's base URL and the given sub URL
buildURL: function(subURL) {
var baseURL = jQuery(this).attr('href');
if (!baseURL) baseURL = this.ownerForm().action + '/field/' + this.getName() + '/';
var subHasQuerystring = subURL.match(/\?/);
if(baseURL.match(/^(.*)\?(.*)$/)) {