1 2 3 4 5 6 7 8 9 10 11 12 13 | <script type="text/javascript">
$(function(){
$("select+a.add-another").each(function(){
$(this).after(" <a class='changelink' href='#'></a>");
$(this).next().click(function(){
var link = ($(this).prev().attr('href')+'../'+$(this).prev().prev().attr('value'));
var win = window.open(link + '?_popup=1', link, 'height=600,width=1000,resizable=yes,scrollbars=yes');
win.focus();
return false;
});
});
});
</script>
|
Comments
Thanks! That's exactly what I was looking for...
I modified it a little so that if nothing's selected in the FK field it just opens the generic 'select object to change' popup (instead of throwing an error).
` $(function(){
`
#
With this two lines patch, Save button close the window.
#
Two little changes: added a title attribute to the edit icon and a simple if that prevents opening a new window in case nothing is selected:
#