Mercurial > defr > drupal > noderef_view
diff noderef_view.js @ 2:25a0c2fcbcfb
Don't wrap the field in a div, it may cause problems.
Instead, we just go back in the DOM 'till we find the div holding the
real data. It's not really all that good, but, it seems to do the job.
author | Franck Deroche <franck@defr.org> |
---|---|
date | Fri, 23 Jan 2009 18:57:45 +0100 |
parents | a3c1e224e807 |
children | b4c1e3d5d5ce |
line wrap: on
line diff
--- a/noderef_view.js Fri Jan 23 17:03:10 2009 +0100 +++ b/noderef_view.js Fri Jan 23 18:57:45 2009 +0100 @@ -6,8 +6,10 @@ $('.noderef_view_link', context).each(function(i, obj) { $(obj).addClass('noderef_view_link_processed').click(function() { // Get the wrapper - var id = $(this).attr('rel'); - var wrapper = $('#' + id); + var wrapper = $(this).prev(); + while (!wrapper.is('div')) { + wrapper = wrapper.prev(); + } // Suppress behavior if it was previsously attached $(document).unbind('popups_form_success.noderef_view');