From 86addea1d2a7b2e28ae8115279ae358bcb46648a Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Fri, 16 Feb 2018 23:16:09 +1300 Subject: [PATCH 1/2] FIX Split HTML manipulation to onadd, so elements are not accidentally duplicated --- javascript/TreeDropdownField.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/javascript/TreeDropdownField.js b/javascript/TreeDropdownField.js index 32453695e..21d691fe3 100644 --- a/javascript/TreeDropdownField.js +++ b/javascript/TreeDropdownField.js @@ -47,13 +47,15 @@ // XMLHttpRequest CurrentXhr: null, - onmatch: function() { + onadd: function() { this.append( '' + '' + '
' ); + }, + onmatch: function() { var linkTitle = strings.openLink; if(linkTitle) this.find("treedropdownfield-toggle-panel-link a").attr('title', linkTitle); if(this.data('title')) this.setTitle(this.data('title')); @@ -334,7 +336,7 @@ }); $('.TreeDropdownField.searchable').entwine({ - onmatch: function() { + onadd: function() { this._super(); var title = ss.i18n._t('TreeDropdownField.ENTERTOSEARCH'); this.find('.treedropdownfield-panel').prepend( From 6fb8d27ac57559031efef15f650562cfc77e4c33 Mon Sep 17 00:00:00 2001 From: Benjamin Blake Date: Sun, 11 Mar 2018 14:49:17 -0600 Subject: [PATCH 2/2] Updated the DocBlock for ManyManyList's add() method --- model/ManyManyList.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/model/ManyManyList.php b/model/ManyManyList.php index bf586edc7..85a3d2395 100644 --- a/model/ManyManyList.php +++ b/model/ManyManyList.php @@ -188,6 +188,13 @@ class ManyManyList extends RelationList { * Add an item to this many_many relationship * Does so by adding an entry to the joinTable. * + * Can also be used to update an already existing joinTable entry + * + * Example: + * + * $manyManyList->add($recordID,["ExtraField"=>"value"]); + * + * * @throws InvalidArgumentException * @throws Exception *