Permalink
Browse files

added a quick solution to fix inline items

  • Loading branch information...
mlouro committed May 3, 2011
1 parent 161a2da commit e81fbec92b9c8c6af0828b00b1d747f6f18e6f8e
Showing with 7 additions and 3 deletions.
  1. +7 −3 salmonella/static/salmonella.js
@@ -1,13 +1,17 @@
function popup_wrapper(triggerLink, app_name, model_name){
- var name = triggerLink.id.replace(/^lookup_/, '');
- name = id_to_windowname(name);
+ var name = triggerLink.id.replace(/^lookup_/, ''),
+ windowName = id_to_windowname(name);
// Actual Django javascript function
showRelatedObjectLookupPopup(triggerLink);
// Sets focus on input field so event is
// fired correctly.
- document.getElementById(name).focus();
+ try {
+ document.getElementById(windowName).focus();
+ } catch (e) {
+ document.getElementById(name).focus();
+ }
return false;
}

0 comments on commit e81fbec

Please sign in to comment.