Merge lp:~huwshimi/juju-gui/background-drag into lp:juju-gui/experimental

Proposed by Huw Wilkins
Status: Merged
Merged at revision: 1216
Proposed branch: lp:~huwshimi/juju-gui/background-drag
Merge into: lp:juju-gui/experimental
Diff against target: 14 lines (+5/-0)
1 file modified
app/views/topology/panzoom.js (+5/-0)
To merge this branch: bzr merge lp:~huwshimi/juju-gui/background-drag
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+197320@code.launchpad.net

Description of the change

Background panning

Fixed the background so that it moves when you pan the canvas. This has been bothering me for a while. Works for me accross browsers.

https://codereview.appspot.com/35880043/

To post a comment you must log in.
Revision history for this message
Huw Wilkins (huwshimi) wrote :

Reviewers: mp+197320_code.launchpad.net,

Message:
Please take a look.

Description:
Background panning

Fixed the background so that it moves when you pan the canvas. This has
been bothering me for a while. Works for me accross browsers.

https://code.launchpad.net/~huwshimi/juju-gui/background-drag/+merge/197320

(do not edit description out of merge proposal)

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

Affected files (+7, -0 lines):
   A [revision details]
   M app/views/topology/panzoom.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/topology/panzoom.js
=== modified file 'app/views/topology/panzoom.js'
--- app/views/topology/panzoom.js 2013-10-14 19:38:47 +0000
+++ app/views/topology/panzoom.js 2013-12-02 07:29:52 +0000
@@ -259,6 +259,11 @@
        topo.set('translate', Y.mix(evt.translate));
        vis.attr('transform', 'translate(' + topo.get('translate') + ')' +
                ' scale(' + topo.get('scale') + ')');
+ var canvas = Y.one('.topology-canvas');
+ if (canvas) {
+ var bgPosition = evt.translate[0] + 'px ' + evt.translate[1]
+ 'px';
+ canvas.setStyle('backgroundPosition', bgPosition);
+ }
        topo.fire('rescaled');
      },

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/views/topology/panzoom.js'
2--- app/views/topology/panzoom.js 2013-10-14 19:38:47 +0000
3+++ app/views/topology/panzoom.js 2013-12-02 07:35:41 +0000
4@@ -259,6 +259,11 @@
5 topo.set('translate', Y.mix(evt.translate));
6 vis.attr('transform', 'translate(' + topo.get('translate') + ')' +
7 ' scale(' + topo.get('scale') + ')');
8+ var canvas = Y.one('.topology-canvas');
9+ if (canvas) {
10+ var bgPosition = evt.translate[0] + 'px ' + evt.translate[1] + 'px';
11+ canvas.setStyle('backgroundPosition', bgPosition);
12+ }
13 topo.fire('rescaled');
14 },
15

Subscribers

People subscribed via source and target branches