Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #357 from kadams54/service-dblclick
Browse files Browse the repository at this point in the history
Full confession: I didn't actually do anything to fix the inspector breakage. I was able to duplicate the bug a few times initially and then unable to duplicate once I started working on it. The destructor in `viewlet-manager.js` should handle removing the DOM node, which is what I thought the original problem was.

Instead I ended up removing the double click event, since there's no longer any difference between clicking once and clicking twice.

## QA

With the `il` flag.

1. Drag a charm to the canvas
2. Deploy it
3. Double click on the service icon
4. Close the inspector

Ensure the sidebar does not break and reverts back to the charmbrowser as expected. You can also inspect the DOM and make sure `<div class="bws-content">` has only one child.
  • Loading branch information
jujugui committed Jun 3, 2014
2 parents 8916cea + 1ae61e1 commit dd679bc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
14 changes: 0 additions & 14 deletions app/views/topology/service.js
Expand Up @@ -301,7 +301,6 @@ YUI.add('juju-topology-service', function(Y) {
scene: {
'.service': {
click: 'serviceClick',
dblclick: 'serviceDblClick',
mouseenter: 'serviceMouseEnter',
mouseleave: 'serviceMouseLeave',
mousemove: 'serviceMouseMove'
Expand Down Expand Up @@ -539,19 +538,6 @@ YUI.add('juju-topology-service', function(Y) {
self[curr_click_action](box, topo);
},

serviceDblClick: function(box, self) {
if (box.pending) {
return;
}
// Just show the service on double-click.
var service = box.model;
// The browser sends a click event right before the dblclick one, and
// it opens the service menu: close it before moving to the service
// details.
self.hideServiceMenu();
self.show_service(service);
},

serviceMouseEnter: function(box, context) {
var rect = Y.one(this);
// Do not fire if this service isn't selectable.
Expand Down
11 changes: 0 additions & 11 deletions test/test_service_module.js
Expand Up @@ -205,17 +205,6 @@ describe('service module events', function() {
return viewContainer.one('#service-menu');
};

it('should not show the service menu after the service is double-clicked',
function() {
var service = viewContainer.one('.service');
var menu = clickService(service);

// Ideally the browser would not send the click event right away...
assert(menu.hasClass('active'));
service.simulate('dblclick');
assert.isFalse(menu.hasClass('active'));
});

it('should handle touch/click events properly', function() {
var service = viewContainer.one('.service');
var menu = viewContainer.one('#service-menu');
Expand Down
1 change: 0 additions & 1 deletion undocumented
Expand Up @@ -132,7 +132,6 @@ app/views/topology/service.js:1365 "show"
app/views/topology/service.js:1015 "dragend"
app/views/topology/service.js:1399 "updateServiceMenuLocation"
app/views/topology/service.js:550 "serviceMouseEnter"
app/views/topology/service.js:537 "serviceDblClick"
app/views/topology/service.js:401 "initializer"
app/views/topology/service.js:574 "serviceMouseLeave"
app/views/topology/topology.js:289 "setter"
Expand Down

0 comments on commit dd679bc

Please sign in to comment.