Needs review
Project:
Popups: Add and Reference
Version:
6.x-2.0-alpha1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2009 at 19:50 UTC
Updated:
3 May 2010 at 17:07 UTC
Jump to comment: Most recent file
Comments
Comment #1
cyu commentedBah, I guess it isn't as easy as I was trying to make it. When .find() finds nothing and then .end().change() is fired it will throw JS errors. My jquery chops are a bit lacking, so I don't know the best way of making this happen conditionally.
Comment #2
cyu commentedComment #3
cyu commentedIs something like this sensible?
Comment #4
starbow commentedInteresting.
Can't you just bind an onChange trigger to the elements directly in your custom code?
Comment #5
cyu commentedYes, my code is bound to change() but without this patch it is not fired after a new nodereference is created in popups: add and reference. I thought it would, but doing something like
to change the input's value will not fire the change event, which is what this patch would explicitly do after form element values are set.
Comment #6
starbow commentedOk, that totally makes sense.
If you can change the patch to be against 2.0-alpha1 (the 1.0 branch is closed to new features), and try extracting
into a stand alone function, to keep the code neat, I will put it into 2.0-alpha2.
Thanks,
-t
Comment #7
cyu commentedOk, I've moved that code into it's own function. My testing indicated that .end() was not needed in the places I was using it so I removed those calls.
Comment #8
ulechka commentedHello!
I've changed your patch a little, just added nid to autocompletion field this way:
$emptyAutos.eq(0).val(title + ' [nid:' + nid + ']').change();
and now inline references really works for me after popups "Add new [node-type]"