Why?
I have a use case where I alter the relation select form by adding an "Add" button which makes an separate AJAX call to a handler creating an entity for me.
Now, my next step is to extend with couple extra functions working together with functions inside Drupal.behaviors.relationSelect but the problem is that some of the functions are using relationSelectItems variable and it's not accessible outside the behavior function.
Proposed solution
Make relationSelectItems global by creating an property for Drupal object as follows:
Drupal.relationSelect = {
items: {}
}
Then just rename the variables from relationSelectItems to Drupal.relationSelect.items.
Comments
Comment #1
imiksuHere is a patch file of the proposed solution.
Comment #2
imiksuAfter a while of struggling around with my use case, I found out that there is plenty of other things to do before getting my use case to work.
This feature request goes irrelevant in that case..