Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(438)

Issue 7131060: Hide service menu on service double click.

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by teknico
Modified:
12 years, 9 months ago
Reviewers:
bac, mp+143851, gary.poster
Visibility:
Public.

Description

Hide service menu on service double click. Hide the service menu when the service is double clicked. The browser sends a click event first (which opens the service menu), then the double click, so we need to manually hide the menu before opening the service details. With test. Also, rename the toggleControlPanel service method to toggleServiceMenu (because that's what we call it everywhere else), and split its implementation into two methods: showServiceMenu and hideServiceMenu. Use the latter in place of the toggle one in the places (most of them) where it is the intended meaning. https://code.launchpad.net/~teknico/juju-gui/1099926-no-svc-menu-on-dblclk/+merge/143851 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -31 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M app/views/topology/relation.js View 5 chunks +5 lines, -5 lines 2 comments Download
M app/views/topology/service.js View 9 chunks +44 lines, -19 lines 4 comments Download
M test/test_environment_view.js View 3 chunks +5 lines, -5 lines 1 comment Download
M test/test_service_module.js View 2 chunks +56 lines, -1 line 1 comment Download
M undocumented View 1 chunk +3 lines, -1 line 3 comments Download

Messages

Total messages: 5
teknico
Please take a look.
12 years, 9 months ago (2013-01-18 10:50:58 UTC) #1
bac
Thanks for the fix/work-around to very annoying browser behavior. There are two style changes I ...
12 years, 9 months ago (2013-01-18 12:24:43 UTC) #2
teknico
Thanks, Brad. I will add the "var" keywords. I would also like to document the ...
12 years, 9 months ago (2013-01-18 12:31:29 UTC) #3
teknico
teknico wrote: > ...I'll some help with that. ...I'll *need* some help... :-/
12 years, 9 months ago (2013-01-18 12:32:27 UTC) #4
gary.poster
12 years, 9 months ago (2013-01-18 13:23:05 UTC) #5
Land with changes. Thank you, Nicola. This is a nice branch, with a number of improvements in clarity and a nice test. Gary https://codereview.appspot.com/7131060/diff/1/app/views/topology/relation.js File app/views/topology/relation.js (right): https://codereview.appspot.com/7131060/diff/1/app/views/topology/relation.js#... app/views/topology/relation.js:278: On 2013/01/18 12:24:43, bac wrote: > Much clearer. Agreed. I'm hoping it is in fact "hide" rather than "toggle" and will try to keep an eye out in your branch for that confirmation. https://codereview.appspot.com/7131060/diff/1/app/views/topology/service.js File app/views/topology/service.js (right): https://codereview.appspot.com/7131060/diff/1/app/views/topology/service.js#n... app/views/topology/service.js:746: toggleServiceMenu: function(m, view, context) { Yes, I see what we have now. Nicer name here, and nicer clarity below when we actually want to explicitly hide or show within the code base. Thank you. https://codereview.appspot.com/7131060/diff/1/app/views/topology/service.js#n... app/views/topology/service.js:762: On 2013/01/18 12:24:43, bac wrote: > one 'var' per variable We never made this a requirement, for a reason I don't recall, but I agree that it is a good way forward generally. It doesn't buy us much in this particular case, but I don't mind it. https://codereview.appspot.com/7131060/diff/1/test/test_environment_view.js File test/test_environment_view.js (right): https://codereview.appspot.com/7131060/diff/1/test/test_environment_view.js#n... test/test_environment_view.js:503: // Tests for the service menu. Given that we now have explicit methods for showing and hiding, testing those wouldn't be amiss, I think. In both cases, a full set of tests would be to show that it acts when it needs to and is a no-op otherwise. https://codereview.appspot.com/7131060/diff/1/test/test_service_module.js File test/test_service_module.js (right): https://codereview.appspot.com/7131060/diff/1/test/test_service_module.js#new... test/test_service_module.js:131: assert.isFalse(menu.hasClass('active')); Cool, thank you. https://codereview.appspot.com/7131060/diff/1/undocumented File undocumented (right): https://codereview.appspot.com/7131060/diff/1/undocumented#newcode192 undocumented:192: app/views/topology/service.js:128 "initializer" On 2013/01/18 12:31:29, teknico wrote: > bac wrote: > > I think it would've been nice to actually document these functions rather than > > add them here. This file should be decreasing in size. > > You are entirely right. I tried to do so but could not, because I am not sure I > understand what the calling parameters mean. I looked at the invocations and at > other similar methods in the same context, and there is too much variation in > names and invocation pattern to be sure of the intended meaning. While I agree with you that this is not clear, that means it would be a fantastic thing to document, right? :-) bcsaller will be able to help you here, I am sure. Please do document these (and toggleServiceMenu while you are at it) as part of this branch.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b