Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENHANCEMENT Triggering jQuery events in TreeSelectorField.js in prepa…

…ration to switching the tree logic to jQuery. This prevents developers from using the soon-to-be-deprecated Observable prototype

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92541 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit d95f8679458470b7d53c8f890c3fc500411f5134 1 parent 28109df
@chillu chillu authored
Showing with 3 additions and 0 deletions.
  1. +1 −0  forms/TreeSelectorField.php
  2. +2 −0  javascript/TreeSelectorField.js
View
1  forms/TreeSelectorField.php
@@ -18,6 +18,7 @@ function Field() {
Requirements::javascript(THIRDPARTY_DIR . "/prototype_improvements.js");
Requirements::add_i18n_javascript(SAPPHIRE_DIR . '/javascript/lang');
+ Requirements::javascript(SAPPHIRE_DIR . "/thirdparty/jquery/jquery.js");
Requirements::javascript(SAPPHIRE_DIR . "/javascript/TreeSelectorField.js");
$fieldName = $this->name;
View
2  javascript/TreeSelectorField.js
@@ -208,6 +208,7 @@ TreeDropdownField.prototype = {
if(this.inputTag.value != val) {
this.inputTag.value = val;
+ jQuery(this).trigger('ss.TreeDropdownField.change', {val: val});
this.notify('Change', val);
// If the tree item is already downloaded, just update the label
@@ -240,6 +241,7 @@ TreeDropdownField.prototype = {
setValueFromTree: function(treeID, title) {
this.humanItems.innerHTML = title;
this.inputTag.value = treeID.replace('selector-' + this.getName() + '-','');
+ jQuery(this).trigger('ss.TreeDropdownField.change', {val: this.inputTag.value});
this.notify('Change', this.inputTag.value);
this.hideTree();
Please sign in to comment.
Something went wrong with that request. Please try again.