Merge lp:~rharding/juju-gui/animation1 into lp:juju-gui/experimental

Proposed by Richard Harding
Status: Work in progress
Proposed branch: lp:~rharding/juju-gui/animation1
Merge into: lp:juju-gui/experimental
Diff against target: 334 lines (+147/-71)
9 files modified
app/subapps/browser/browser.js (+3/-3)
app/subapps/browser/templates/fullscreen.handlebars (+0/-1)
app/subapps/browser/templates/minimized.handlebars (+1/-1)
app/subapps/browser/templates/sidebar.handlebars (+1/-1)
app/subapps/browser/views/charm.js (+15/-7)
app/subapps/browser/views/view.js (+17/-7)
lib/views/browser/browser-icon.less (+33/-5)
lib/views/browser/main.less (+73/-46)
lib/views/browser/minimized.less (+4/-0)
To merge this branch: bzr merge lp:~rharding/juju-gui/animation1
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+177878@code.launchpad.net

Description of the change

TBD

To post a comment you must log in.

Unmerged revisions

917. By Richard Harding

Update to catch the details on close as well

916. By Richard Harding

More work on getting charm details to work right

915. By Richard Harding

Work on adjusting the css/html to allow for the sidebar/tab animations

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/subapps/browser/browser.js'
2--- app/subapps/browser/browser.js 2013-07-29 17:47:25 +0000
3+++ app/subapps/browser/browser.js 2013-07-31 15:27:38 +0000
4@@ -52,11 +52,11 @@
5 container = Y.one('.charmbrowser');
6 if (detailsNode) {
7 if (visible) {
8- detailsNode.show();
9+ // detailsNode.show();
10 container.addClass('content-visible');
11 }
12 else {
13- detailsNode.hide();
14+ // detailsNode.hide();
15 container.removeClass('content-visible');
16 }
17 }
18@@ -742,7 +742,7 @@
19 this._detailsVisible(false);
20 var detailsNode = Y.one('.bws-view-data');
21 if (detailsNode) {
22- detailsNode.hide();
23+ // detailsNode.hide();
24 }
25 // Clean up any details we've got.
26 if (this._details) {
27
28=== modified file 'app/subapps/browser/templates/fullscreen.handlebars'
29--- app/subapps/browser/templates/fullscreen.handlebars 2013-07-11 06:11:21 +0000
30+++ app/subapps/browser/templates/fullscreen.handlebars 2013-07-31 15:27:38 +0000
31@@ -1,5 +1,4 @@
32 <div class="charmbrowser">
33- <a href="" class="bws-icon"></a>
34 <div id="bws-fullscreen">
35 <div class="bws-header-wrapper">
36 <div class="bws-header">
37
38=== modified file 'app/subapps/browser/templates/minimized.handlebars'
39--- app/subapps/browser/templates/minimized.handlebars 2013-07-03 22:55:30 +0000
40+++ app/subapps/browser/templates/minimized.handlebars 2013-07-31 15:27:38 +0000
41@@ -1,1 +1,1 @@
42-<a href="" class="bws-icon"></a>
43+<div class="bws-icon"><a href="">&nbsp;</a></div>
44
45=== modified file 'app/subapps/browser/templates/sidebar.handlebars'
46--- app/subapps/browser/templates/sidebar.handlebars 2013-07-15 15:01:59 +0000
47+++ app/subapps/browser/templates/sidebar.handlebars 2013-07-31 15:27:38 +0000
48@@ -1,5 +1,5 @@
49 <div class="charmbrowser">
50- <a href="" class="bws-icon"></a>
51+ <div class="bws-icon"><a href="">&nbsp;</a></div>
52 <div id="bws-sidebar">
53 <div class="bws-header">
54 </div>
55
56=== modified file 'app/subapps/browser/views/charm.js'
57--- app/subapps/browser/views/charm.js 2013-07-30 14:03:43 +0000
58+++ app/subapps/browser/views/charm.js 2013-07-31 15:27:38 +0000
59@@ -266,13 +266,22 @@
60
61 */
62 _handleBack: function(ev) {
63+ var self = this;
64 ev.halt();
65- this.fire('viewNavigate', {
66- change: {
67- charmID: null,
68- hash: null
69- }
70- });
71+
72+ var renderTo = this.get('renderTo');
73+ // XXX: hack to help me get the animations going. This class should not
74+ // be messing with css outside of its area of control.
75+ Y.one('.charmbrowser').removeClass('content-visible');
76+
77+ setTimeout(function() {
78+ self.fire('viewNavigate', {
79+ change: {
80+ charmID: null,
81+ hash: null
82+ }
83+ });
84+ }, 500);
85 },
86
87 /**
88@@ -724,7 +733,6 @@
89 });
90 this._dispatchTabEvents(this.tabview);
91
92-
93 if (isFullscreen) {
94 if (!this.get('charm').get('relatedCharms')) {
95 this.showIndicator(Y.one('.related-charms'));
96
97=== modified file 'app/subapps/browser/views/view.js'
98--- app/subapps/browser/views/view.js 2013-07-30 14:03:43 +0000
99+++ app/subapps/browser/views/view.js 2013-07-31 15:27:38 +0000
100@@ -1,7 +1,7 @@
101 /*
102-This file is part of the Juju GUI, which lets users view and manage Juju
103+this file is part of the juju gui, which lets users view and manage juju
104 environments within a graphical interface (https://launchpad.net/juju-gui).
105-Copyright (C) 2012-2013 Canonical Ltd.
106+copyright (c) 2012-2013 canonical ltd.
107
108 This program is free software: you can redistribute it and/or modify it under
109 the terms of the GNU Affero General Public License version 3, as published by
110@@ -232,13 +232,23 @@
111
112 */
113 _toggleBrowser: function(ev) {
114+ var self = this;
115 ev.halt();
116
117- this.fire('viewNavigate', {
118- change: {
119- viewmode: 'minimized'
120- }
121- });
122+ // Update the CSS on the sidebar to allow it to animate out of the way.
123+ this.get('container').one('.charmbrowser').addClass('hideme-slowly');
124+ // Make sure we also sync any visible charm details with this animation
125+ // to close.
126+ Y.one('.charmbrowser').removeClass('content-visible');
127+
128+
129+ window.setTimeout(function() {
130+ self.fire('viewNavigate', {
131+ change: {
132+ viewmode: 'minimized'
133+ }
134+ });
135+ }, 400);
136 },
137
138 /**
139
140=== modified file 'lib/views/browser/browser-icon.less'
141--- lib/views/browser/browser-icon.less 2013-07-16 05:10:27 +0000
142+++ lib/views/browser/browser-icon.less 2013-07-31 15:27:38 +0000
143@@ -1,16 +1,44 @@
144 .bws-icon {
145+ background-color: #bbbbbb;
146 position: absolute;
147 display: block;
148 left: @bws-sidebar-width;
149 top: 114px;
150- width: 40px;
151- height: 40px;
152- background: #bbbbbb url(/juju-ui/assets/images/browser_icon.png)
153- no-repeat center center;
154+
155 box-shadow: 3px 0 2px rgba(0, 0, 0, 0.1);
156 border-top-right-radius: 4px;
157 border-bottom-right-radius: 4px;
158-}
159+
160+ // Adjust the left position when hiding the sidebar from view
161+ transition: left .3s ease-in-out;
162+
163+ &:hover a {
164+ margin-left: 5px;
165+ }
166+
167+ a {
168+ background: #bbbbbb url(/juju-ui/assets/images/browser_icon.png)
169+ no-repeat center center;
170+
171+ border-bottom-right-radius: 4px;
172+ border-top-right-radius: 4px;
173+ display: block;
174+ height: 40px;
175+ width: 40px;
176+
177+ // Transition a margin when hovering over the bws-icon tab.
178+ transition: margin-left .2s ease-in-out;
179+ }
180+}
181+
182+.charmbrowser.hideme-slowly {
183+ &.hideme-slowly {
184+ .bws-icon {
185+ left: -@bws-sidebar-width;
186+ }
187+ }
188+}
189+
190 .content-visible .bws-icon {
191 left: @bws-sidebar-width + @bws-panel-width;
192 }
193
194=== modified file 'lib/views/browser/main.less'
195--- lib/views/browser/main.less 2013-07-26 06:43:11 +0000
196+++ lib/views/browser/main.less 2013-07-31 15:27:38 +0000
197@@ -126,50 +126,77 @@
198 padding: 0 0 0 50px;
199 }
200 }
201- #bws-sidebar {
202- z-index: 2;
203- right: auto;
204- width: @bws-sidebar-width;
205- min-width: @bws-sidebar-min-width;
206- border-right: 1px solid #a5a5a5;
207- box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
208-
209- .bws-searchbox {
210- width: 100%;
211- }
212- .bws-content {
213- top: @bws-sidebar-header-height;
214- border-top: 8px solid @bws-sidebar-content-top-border;
215-
216- &.with-home {
217- top: @bws-sidebar-header-height-with-home;
218- }
219-
220- .section-title {
221- padding-left: 20px;
222- padding-right: 20px;
223- }
224- .yui3-charmtoken {
225- width: 100%;
226- border-top: 1px solid @bws-groove-light;
227- border-bottom: 1px solid @bws-groove-dark;
228-
229- .title {
230- max-width: 135px;
231- }
232- .description {
233- display: none;
234- }
235- &:hover {
236- background-color: #eee;
237- }
238- }
239- }
240- }
241- .bws-view-data {
242- left: @bws-sidebar-width;
243- width: @bws-panel-width;
244- background-color: #fff;
245- box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
246- }
247+ .charmbrowser {
248+
249+ &.hideme-slowly #bws-sidebar {
250+ left: -@bws-sidebar-width;
251+ }
252+
253+ #bws-sidebar {
254+ z-index: 2;
255+ right: auto;
256+ width: @bws-sidebar-width;
257+ min-width: @bws-sidebar-min-width;
258+ border-right: 1px solid #a5a5a5;
259+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
260+
261+ // This animation is timed with a navigate timeout in the base
262+ // subapp/views.js. Make sure that the timeout is adjusted if the timing
263+ // here is changed.
264+ transition: all .3s ease-in-out;
265+
266+ .bws-searchbox {
267+ width: 100%;
268+ }
269+ .bws-content {
270+ top: @bws-sidebar-header-height;
271+ border-top: 8px solid @bws-sidebar-content-top-border;
272+
273+ &.with-home {
274+ top: @bws-sidebar-header-height-with-home;
275+ }
276+
277+ .section-title {
278+ padding-left: 20px;
279+ padding-right: 20px;
280+ }
281+ .yui3-charmtoken {
282+ width: 100%;
283+ border-top: 1px solid @bws-groove-light;
284+ border-bottom: 1px solid @bws-groove-dark;
285+
286+ .title {
287+ max-width: 135px;
288+ }
289+ .description {
290+ display: none;
291+ }
292+ &:hover {
293+ background-color: #eee;
294+ }
295+ }
296+ }
297+ }
298+ }
299+
300+ .charmbrowser {
301+
302+ &.hideme-slowly .bws-view-data {
303+ left: -@bws-panel-width - @bws-sidebar-width;
304+ }
305+
306+ .bws-view-data {
307+ left: -@bws-panel-width + @bws-sidebar-width;
308+ width: @bws-panel-width;
309+ transition: left .3s ease-in-out;
310+ }
311+
312+ &.content-visible .bws-view-data {
313+ left: @bws-sidebar-width;
314+ width: @bws-panel-width;
315+ background-color: #fff;
316+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
317+ }
318+ }
319+
320 }
321
322=== modified file 'lib/views/browser/minimized.less'
323--- lib/views/browser/minimized.less 2013-07-03 22:56:16 +0000
324+++ lib/views/browser/minimized.less 2013-07-31 15:27:38 +0000
325@@ -10,5 +10,9 @@
326 left: 0;
327 right: auto;
328 background-color: @charm-panel-orange;
329+
330+ a {
331+ background-color: @charm-panel-orange;
332+ }
333 }
334 }

Subscribers

People subscribed via source and target branches