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

Issue 6819104: Generic show view event

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 5 months ago by thiago
Modified:
8 years, 4 months ago
Reviewers:
mp+133247
Visibility:
Public.

Description

Generic show view event Instead of wrapping the 'navigate' method call with multiple 'show' events, we want call the 'navigate' method from a single event. So, instead of... this.on('*:showService', this.navigate_to_service); this.on('*:showUnit', this.navigate_to_unit); this.on('*:showCharm', this.navigate_to_charm); this.on('*:showEnvironment', this.navigate_to_environment); ... we will have... this.on('*:navigateTo', function(e) { console.log('navigateTo', e); this.navigate(e.url); }, this); https://code.launchpad.net/~tveronezi/juju-gui/generic-show-view-event/+merge/133247 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 10

Patch Set 2 : Generic show view event #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -54 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M app/app.js View 2 chunks +5 lines, -42 lines 0 comments Download
M app/views/charm.js View 1 2 chunks +3 lines, -2 lines 0 comments Download
M app/views/environment.js View 2 chunks +2 lines, -2 lines 0 comments Download
M app/views/service.js View 1 2 chunks +5 lines, -3 lines 0 comments Download
M app/views/unit.js View 1 1 chunk +2 lines, -1 line 0 comments Download
M test/test_charm_view.js View 1 chunk +2 lines, -1 line 0 comments Download
M test/test_service_view.js View 2 chunks +4 lines, -2 lines 0 comments Download
M test/test_unit_view.js View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 5
thiago
Please take a look.
11 years, 5 months ago (2012-11-07 13:53:23 UTC) #1
benji
This branch looks good. The added test assertions were a nice touch. The only problem ...
11 years, 5 months ago (2012-11-07 18:12:57 UTC) #2
bac
Since Benji picked all of the nits I think this branch looks good. Nice simplification ...
11 years, 5 months ago (2012-11-07 21:46:06 UTC) #3
thiago
Thanks guys! https://codereview.appspot.com/6819104/diff/1/app/views/charm.js File app/views/charm.js (right): https://codereview.appspot.com/6819104/diff/1/app/views/charm.js#newcode90 app/views/charm.js:90: this.fire('navigateTo', { On 2012/11/07 18:12:57, benji wrote: ...
11 years, 5 months ago (2012-11-08 16:22:01 UTC) #4
thiago
11 years, 5 months ago (2012-11-08 16:28:14 UTC) #5
*** Submitted:

Generic show view event

Instead of wrapping the 'navigate' method call with multiple 'show' events, we
want call the 'navigate' method from a single event.

So, instead of...

this.on('*:showService', this.navigate_to_service);
this.on('*:showUnit', this.navigate_to_unit);
this.on('*:showCharm', this.navigate_to_charm);
this.on('*:showEnvironment', this.navigate_to_environment);

... we will have...

this.on('*:navigateTo', function(e) {
 console.log('navigateTo', e);
 this.navigate(e.url);
}, this);

R=benji, bac
CC=
https://codereview.appspot.com/6819104
Sign in to reply to this message.

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