Merge lp:~frankban/juju-gui/bug-1090046-resize into lp:juju-gui/experimental
Proposed by
Francesco Banconi
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 282 | ||||
Proposed branch: | lp:~frankban/juju-gui/bug-1090046-resize | ||||
Merge into: | lp:juju-gui/experimental | ||||
Diff against target: |
84 lines (+41/-4) 3 files modified
app/assets/javascripts/d3-components.js (+6/-3) test/test_d3_components.js (+18/-0) test/test_environment_view.js (+17/-1) |
||||
To merge this branch: | bzr merge lp:~frankban/juju-gui/bug-1090046-resize | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+139959@code.launchpad.net |
Description of the change
Fix GUI breakage on browser resizing.
Fixed how yui events are handled by the component framework.
Also added two tests:
- ensure that the module synthetic events binding works;
- ensure that the custom events 'beforePageSize
and 'afterPageSizeR
the environment view when the browser is resized.
QA: resize the browser, open the charm panel, resize the
browser again, close the charm panel, resize again,
re-open the panel...
To post a comment you must log in.
Reviewers: mp+139959_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix GUI breakage on browser resizing.
Fixed how yui events are handled by the component framework. Recalculation' ecalculation' are correctly fired by
Also added two tests:
- ensure that the module synthetic events binding works;
- ensure that the custom events 'beforePageSize
and 'afterPageSizeR
the environment view when the browser is resized.
QA: resize the browser, open the charm panel, resize the
browser again, close the charm panel, resize again,
re-open the panel...
https:/ /code.launchpad .net/~frankban/ juju-gui/ bug-1090046- resize/ +merge/ 139959
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/6941053/
Affected files: javascripts/ d3-components. js d3_components. js environment_ view.js
A [revision details]
M app/assets/
M test/test_
M test/test_
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: test/test_ d3_components. js d3_components. js' d3_components. js 2012-11-09 14:17:58 +0000 d3_components. js 2012-12-14 15:25:55 +0000
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -129,6 +129,24 @@
});
+ it('should correctly handle synthetic event bindings', function(done) { {container: container}); zeHandler = function(evt) { yui.windowresiz e = 'windowResizeHa ndler'; modA); 'windowresize' , function(evt) { detach( ); isTrue( resized) ; window' ).simulate( 'resize' );
+ comp = new NS.Component();
+ comp.setAttrs(
+ modA = new TestModule();
+ var resized = false;
+ modA.windowResi
+ resized = true;
+ };
+ modA.events.
+ comp.addModule(
+ var subscription = Y.after(
+ subscription.
+ assert.
+ done();
+ });
+ Y.one('
+ });
+
it('should support basic rendering from all modules',
function() {
var modA = new TestModule(),
Index: test/test_ environment_ view.js environment_ view.js' environment_ view.js 2012-12-05 18:37:01 +0000 environment_ view.js 2012-12-14 15:25:55 +0000
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -103,7 +103,7 @@
});
beforeEac h(function( done) { 'visibility' , 'hidden');
Y.one( 'body') .prepend( container) ;
db.on_ delta({ data: environment_ delta}) ;
- container = Y.Node.create('<div id="test-container" />');
+ container = Y.Node.create('<div
/>').setStyle(
db = new models.Database();
@@ -118,6 +118,22 @@
done();
});
+ it('must handle the window resize event', function(done) { nt({container: container, db: db}); ntFired = false; 'beforePageSize Recalculation' , function() { e.setSizesFromV iewport. ntFired = true; 'afterPageSizeR ecalculati. ..
+ var view = new views.environme
+ view.render();
+ var beforeResizeEve
+ Y.once(
+ // This event must be fired by
views.MegaModul
+ beforeResizeEve
+ });
+ Y.once(