Merge lp://qastaging/~makyo/juju-gui/drag-interrupted-1099921 into lp://qastaging/juju-gui/experimental
Proposed by
Madison Scott-Clary
Status: | Needs review | ||||
---|---|---|---|---|---|
Proposed branch: | lp://qastaging/~makyo/juju-gui/drag-interrupted-1099921 | ||||
Merge into: | lp://qastaging/juju-gui/experimental | ||||
Diff against target: |
82 lines (+24/-6) 2 files modified
app/views/topology/relation.js (+15/-3) app/views/topology/service.js (+9/-3) |
||||
To merge this branch: | bzr merge lp://qastaging/~makyo/juju-gui/drag-interrupted-1099921 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email:
|
Description of the change
Dragging through annotation updates
Previously, dragging a service would fail when an annotation update was received due to updated objects. This branch and parts of Ben's ViewModel update have helped fix this. This has been tested in one and two browser windows (previously, if the same service was dragged in two browser windows, similar problems would occur).
To post a comment you must log in.
Unmerged revisions
- 360. By Madison Scott-Clary
-
Merge with trunk, lint+beautify
- 359. By Madison Scott-Clary
-
Merged with trunk; dragging no longer interrupted in multiple browser windows.
- 358. By Madison Scott-Clary
-
Dragging no longer interrupted in one browser window.
Reviewers: mp+146228_ code.launchpad. net,
Message:
Please take a look.
Description:
Dragging through annotation updates
Previously, dragging a service would fail when an annotation update was
received due to updated objects. This branch and parts of Ben's
ViewModel update have helped fix this. This has been tested in one and
two browser windows (previously, if the same service was dragged in two
browser windows, similar problems would occur).
https:/ /code.launchpad .net/~makyo/ juju-gui/ drag-interrupte d-1099921/ +merge/ 146228
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/7221087/
Affected files: topology/ relation. js topology/ service. js
A [revision details]
M app/views/
M app/views/
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/ relation. js topology/ relation. js' topology/ relation. js 2013-01-31 02:59:16 +0000 topology/ relation. js 2013-02-01 18:49:00 +0000 kEndpoints: function(evt) {
Y.each( Y.Array. filter( self.relations, function(relation) {
. getConnectorPai r(relation. target) ;
rel_ group.select( 'line')
.attr( 'x1', s[0])
.attr( 'y1', s[1])
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -149,20 +149,32 @@
* Update relation line endpoints for a given service.
*
* @method updateLinkEndpoints
- * @param {Object} service The service module that has been moved.
+ * @param {Object} evt The event facade that was fired. This should
have
+ * a 'service' property mixed in when fired.
*/
updateLin
var self = this;
var service = evt.service;
- return relation.source.id === service.id ||
- relation.target.id === service.id;
+ if (relation.source.id === service.id) {
+ if (service.inDrag === 2) {
+ relation.source = service;
+ }
+ return true;
+ } else if (relation.target.id === service.id) {
+ if (service.inDrag === 2) {
+ relation.target = service;
+ }
+ return true;
+ }
+ return false;
}), function(relation) {
var rel_group = d3.select('#' + relation.id);
var connectors = relation.source
var s = connectors[0];
var t = connectors[1];
+ console.log(s, t);
Index: app/views/ topology/ service. js topology/ service. js' topology/ service. js 2013-02-01 15:40:54 +0000 topology/ service. js 2013-02-01 18:49:00 +0000 'component' );
=== modified file 'app/views/
--- app/views/
+++ app/views/
@@ -311,7 +311,7 @@
**/
drag: function(box, self, pos, includeTransition) {
var topo = self.get(
- var selection = d3.select(this);
+ var selection = topo.vis.select('#' + box.modelId);
if (topo.buildingR elation) {
topo. fire('addRelati onDrag. ..