Code review comment for lp:~makyo/juju-gui/ff-annotations-1192596

Revision history for this message
Madison Scott-Clary (makyo) wrote :

Reviewers: mp+170640_code.launchpad.net,

Message:
Please take a look.

Description:
Fix drag problems on service creation

This bug affected FF and Chrome, causing relation lines to be
mis-aligned and services to jump when dragged. I believe it was due to
lingering attributes on the service boxes after creation. To QA, add
MySQL and Wordpress, relate them, then drag them around a bunch. The
relation line should follow the service blocks, and the service blocks
shouldn't jump to any position when you start to drag them.

https://code.launchpad.net/~makyo/juju-gui/ff-annotations-1192596/+merge/170640

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/10309044/

Affected files:
   A [revision details]
   M app/views/charm-panel.js

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision:
<email address hidden>
+New revision: <email address hidden>

Index: app/views/charm-panel.js
=== modified file 'app/views/charm-panel.js'
--- app/views/charm-panel.js 2013-06-13 22:04:30 +0000
+++ app/views/charm-panel.js 2013-06-20 14:38:57 +0000
@@ -643,7 +643,14 @@
                      env.update_annotations(
                          serviceName, 'service',
                          { 'gui-x': ghostService.get('x'),
- 'gui-y': ghostService.get('y') });
+ 'gui-y': ghostService.get('y') },
+ function() {
+ // The x/y attributes need to be removed to
prevent
+ // lingering position problems after the service
is
+ // positioned by the update code.
+ ghostService.removeAttr('x');
+ ghostService.removeAttr('y');
+ });
                    }
                    // Update the ghost service to match the configuration.
                    ghostService.setAttrs({

« Back to merge proposal