~bcsaller/juju-gui/viewmodel-improvements

Viewing all changes in revision 340.

Fix error while removing relations.

When removing a relation sometimes an exception 
is raised: "Uncaught TypeError: Cannot call method 
'one' of null".
I was able to reproduce the bug following these steps:
1) click on a relation, the remove relation modal 
   dialog appears;
2) open the GUI in another tab, and force a delta stream
   event (e.g. add/remove another relation, 
   destroy a service...);
3) on delta, the relation nodes are redrawn on both tabs,
   so the element stored in the dialog no longer exists
   in the DOM;
4) on the first tab, click to confirm the relation removal,
   you'll see the error.
In this branch, the relation node is retrieved again in
removeRelation using its relation id. This way we ensure
the element actually exists in the DOM.

R=bac, benji
CC=
https://codereview.appspot.com/7199043

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: