Merge lp:~makyo/juju-gui/ff-annotations-1192596 into lp:juju-gui/experimental

Proposed by Madison Scott-Clary
Status: Merged
Merged at revision: 747
Proposed branch: lp:~makyo/juju-gui/ff-annotations-1192596
Merge into: lp:juju-gui/experimental
Diff against target: 19 lines (+8/-1)
1 file modified
app/views/charm-panel.js (+8/-1)
To merge this branch: bzr merge lp:~makyo/juju-gui/ff-annotations-1192596
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+170640@code.launchpad.net

Description of the change

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://codereview.appspot.com/10309044/

To post a comment you must log in.
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({

Revision history for this message
Jeff Pihach (hatch) wrote :

LGTM Thanks. Please create a card to fix the service jumping issue that
those were originally removed to fix.

https://codereview.appspot.com/10309044/

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

*** Submitted:

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.

R=jeff.pihach, teknico
CC=
https://codereview.appspot.com/10309044

https://codereview.appspot.com/10309044/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/views/charm-panel.js'
2--- app/views/charm-panel.js 2013-06-13 22:04:30 +0000
3+++ app/views/charm-panel.js 2013-06-20 14:45:30 +0000
4@@ -643,7 +643,14 @@
5 env.update_annotations(
6 serviceName, 'service',
7 { 'gui-x': ghostService.get('x'),
8- 'gui-y': ghostService.get('y') });
9+ 'gui-y': ghostService.get('y') },
10+ function() {
11+ // The x/y attributes need to be removed to prevent
12+ // lingering position problems after the service is
13+ // positioned by the update code.
14+ ghostService.removeAttr('x');
15+ ghostService.removeAttr('y');
16+ });
17 }
18 // Update the ghost service to match the configuration.
19 ghostService.setAttrs({

Subscribers

People subscribed via source and target branches