Merge lp:~bac/launchpad/accordion-style into lp:launchpad

Proposed by Brad Crittenden on 2011-03-14
Status: Merged
Approved by: Brad Crittenden on 2011-03-14
Approved revision: no longer in the source branch.
Merged at revision: 12591
Proposed branch: lp:~bac/launchpad/accordion-style
Merge into: lp:launchpad
Diff against target: 257 lines (+69/-80)
3 files modified
lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/assets/skins/sam/gallery-accordion-skin.css (+32/-59)
lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/gallery-accordion.js (+37/-11)
lib/lp/registry/templates/product-index.pt (+0/-10)
To merge this branch: bzr merge lp:~bac/launchpad/accordion-style
Reviewer Review Type Date Requested Status
Benji York (community) code 2011-03-14 Approve on 2011-03-14
Review via email: mp+53259@code.launchpad.net

Commit message

[r=benji][no-qa] Update gallery-accordion to latest version. Include the new LP-specific styling.

Description of the change

= Summary =

Update gallery-accordion to latest version. Include the new LP-specific
styling.

== Tests ==

None

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:

lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/assets/skins/sam/gallery-accordion-skin.css

lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/gallery-accordion.js

lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/assets/skins/sam/accordion_sprite.png

./lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/gallery-accordion.js
      22: Line has trailing whitespace.
 ...

Lint ignored as it is third-party code.

To post a comment you must log in.
Brad Crittenden (bac) wrote :

Also removed the reference to lp.registry.pillar from product-index.pt

Benji York (benji) wrote :

Looks good.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/assets/skins/sam/accordion_sprite.png'
2Binary files lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/assets/skins/sam/accordion_sprite.png 2011-02-14 20:14:47 +0000 and lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/assets/skins/sam/accordion_sprite.png 2011-03-14 15:41:23 +0000 differ
3=== modified file 'lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/assets/skins/sam/gallery-accordion-skin.css'
4--- lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/assets/skins/sam/gallery-accordion-skin.css 2011-02-14 20:14:47 +0000
5+++ lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/assets/skins/sam/gallery-accordion-skin.css 2011-03-14 15:41:23 +0000
6@@ -1,31 +1,28 @@
7 .yui3-skin-sam .yui3-accordion {
8- border: 1px solid #93B2CC;
9+ border-width: 1px 1px 0 1px;
10+ border-style: solid;
11+ border-color: #DDD;
12 }
13
14 .yui3-skin-sam .yui3-accordion-item .yui3-widget-hd {
15- background-image: url( accordion_sprite.png );
16- background-position: 0px 0px;
17- border: 1px solid #93B2CC;
18+ background-color: #EEE;
19+ border-bottom: 1px solid #DDD;
20 height: 25px;
21-}
22-
23-.yui3-skin-sam .yui3-accordion-item-icon,
24+ position: relative;
25+ padding-left: 25px;
26+}
27+
28+.yui3-accordion-item .yui3-widget-bd {
29+ border-bottom: 1px solid #DDD;
30+ margin: 0;
31+}
32+
33 .yui3-skin-sam .yui3-accordion-item-iconexpanded,
34-.yui3-skin-sam .yui3-accordion-item-iconalwaysvisible,
35 .yui3-skin-sam .yui3-accordion-item-iconclose {
36 background-repeat: no-repeat;
37 }
38-
39-.yui3-skin-sam .yui3-accordion-item-icon {
40- background-image: url( accordion_sprite.png );
41- background-position: center -25px;
42- _background-position: center -27px;
43-}
44-
45-.yui3-skin-sam .yui3-accordion-item-label{
46- color: #444444;
47-}
48-
49+
50+.yui3-skin-sam .yui3-accordion-item-label:hover,
51 .yui3-skin-sam .yui3-accordion-item-label {
52 text-decoration: none;
53 background: transparent;
54@@ -34,23 +31,8 @@
55 font-weight: bold;
56 }
57
58-.yui3-skin-sam .yui3-accordion-item-label:hover{
59- text-decoration: underline;
60-}
61-
62-.yui3-skin-sam .yui3-accordion-item-iconalwaysvisible,
63-.yui3-skin-sam .yui3-accordion-item-iconalwaysvisible-off {
64- background-image: url( accordion_sprite.png );
65- background-position: 0px -85px;
66- _background-position: 0px -87px;
67-}
68-
69-.yui3-skin-sam .yui3-accordion-item-iconalwaysvisible-on {
70- background-image: url( accordion_sprite.png );
71- background-position: 0px -55px;
72- _background-position: 0px -57px;
73-}
74-
75+.yui3-skin-sam .yui3-accordion-item-iconexpanded-off:hover,
76+.yui3-skin-sam .yui3-accordion-item-iconexpanded-collapsing,
77 .yui3-skin-sam .yui3-accordion-item-iconexpanded,
78 .yui3-skin-sam .yui3-accordion-item-iconexpanded-off {
79 background-image: url( accordion_sprite.png );
80@@ -58,35 +40,14 @@
81 _background-position: 0px -177px;
82 }
83
84-.yui3-skin-sam .yui3-accordion-item-iconexpanded-off:hover{
85- background-image: url( accordion_sprite.png );
86- background-position: 0px -205px;
87-}
88-
89+.yui3-skin-sam .yui3-accordion-item-iconexpanded-on:hover,
90+.yui3-skin-sam .yui3-accordion-item-iconexpanded-expanding,
91 .yui3-skin-sam .yui3-accordion-item-iconexpanded-on {
92 background-image: url( accordion_sprite.png );
93 background-position: 0px -115px;
94 _background-position: 0px -117px;
95 }
96
97-
98-.yui3-skin-sam .yui3-accordion-item-iconexpanded-on:hover {
99- background-image: url( accordion_sprite.png );
100- background-position: 0px -145px;
101-}
102-
103-
104-.yui3-skin-sam .yui3-accordion-item-iconexpanded-expanding {
105- background-image: url( wait_expand.gif );
106- background-position: 0px center;
107-}
108-
109-
110-.yui3-skin-sam .yui3-accordion-item-iconexpanded-collapsing {
111- background-image: url( wait_collapse.gif );
112- background-position: 0px center;
113-}
114-
115 .yui3-skin-sam .yui3-accordion-item-iconclose {
116 background-image: url( accordion_sprite.png );
117 background-position: 0px -235px;
118@@ -102,3 +63,15 @@
119 opacity : 0.7;
120 filter: alpha(opacity = 70);
121 }
122+
123+.yui3-accordion-item-icons {
124+ position: absolute;
125+ float: none;
126+ top: 0;
127+ left: 5px;
128+}
129+
130+.yui3-accordion-item-icon,
131+.yui3-accordion-item-iconalwaysvisible {
132+ display: none;
133+}
134
135=== modified file 'lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/gallery-accordion.js'
136--- lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/gallery-accordion.js 2011-02-14 20:14:47 +0000
137+++ lib/lp/contrib/javascript/yui3-gallery/gallery-accordion/gallery-accordion.js 2011-03-14 15:41:23 +0000
138@@ -266,6 +266,19 @@
139 },
140
141
142+ /**
143+ * Binds an event to Accordion's contentBox.
144+ *
145+ * @method _bindItemChosenEvent
146+ * @protected
147+ */
148+ _bindItemChosenEvent: function(itemChosenEvent) {
149+ var contentBox;
150+
151+ contentBox = this.get( CONTENT_BOX );
152+ contentBox.delegate( itemChosenEvent, Y.bind( this._onItemChosenEvent, this ), '.yui3-widget-hd' );
153+ },
154+
155 /**
156 * Contains items for collapsing
157 * @property _forCollapsing
158@@ -1340,18 +1353,26 @@
159
160
161 /**
162- * Add listener to <code>itemChosen</code> event in Accordion's content box
163+ * Add listener(s) to <code>itemChosen</code> event in Accordion's content box.
164+ * If itemChosen is an Array, this function will invoke multiple times _bindItemChosenEvent
165 *
166 * @method bindUI
167 * @protected
168 */
169 bindUI: function(){
170- var contentBox, itemChosenEvent;
171+ var i, itemChosenEvent, length;
172
173- contentBox = this.get( CONTENT_BOX );
174 itemChosenEvent = this.get( 'itemChosen' );
175
176- contentBox.delegate( itemChosenEvent, Y.bind( this._onItemChosenEvent, this ), '.yui3-widget-hd' );
177+ if( Lang.isArray(itemChosenEvent) ){
178+ length = itemChosenEvent.length;
179+
180+ for( i = 0; i < length; i++ ) {
181+ this._bindItemChosenEvent(itemChosenEvent[i]);
182+ }
183+ } else {
184+ this._bindItemChosenEvent(itemChosenEvent);
185+ }
186 },
187
188
189@@ -1509,7 +1530,7 @@
190 * @return {Y.AccordionItem} The removed item or null if not found
191 */
192 removeItem: function( p_item ){
193- var items, bb, item = null, itemIndex;
194+ var items, bb, item = null, itemIndex, allowed;
195
196 items = this.get( ITEMS );
197
198@@ -1522,11 +1543,14 @@
199 }
200
201 if( itemIndex >= 0 ){
202-
203- this.fire( BEFOREITEMREMOVE, {
204+ allowed = this.fire( BEFOREITEMREMOVE, {
205 item: p_item
206 });
207
208+ if( !allowed ){
209+ return null;
210+ }
211+
212 item = items.splice( itemIndex, 1 )[0];
213
214 this._removeItemHandles( item );
215@@ -1644,16 +1668,18 @@
216 ATTRS : {
217 /**
218 * @description The event on which Accordion should listen for user interactions.
219- * The value can be also mousedown or mouseup. Mousedown event can be used if
220- * drag&drop is not enabled
221+ * The value can be also 'mousedown', 'mouseup' or ['mouseenter','click'].
222+ * Mousedown event can be used if drag&drop is not enabled.
223 *
224 * @attribute itemChosen
225 * @default click
226- * @type String
227+ * @type String|Array
228 */
229 itemChosen: {
230 value: "click",
231- validator: Lang.isString
232+ validator: function( value ) {
233+ return Lang.isString(value) || Lang.isArray(value);
234+ }
235 },
236
237 /**
238
239=== modified file 'lib/lp/registry/templates/product-index.pt'
240--- lib/lp/registry/templates/product-index.pt 2011-03-07 20:07:54 +0000
241+++ lib/lp/registry/templates/product-index.pt 2011-03-14 15:41:23 +0000
242@@ -32,16 +32,6 @@
243 </style>
244 </noscript>
245
246- <script type="text/javascript"
247- tal:content="string:
248- LPS.use('lp.registry.pillar', function(Y) {
249- Y.on('load',
250- function(e) {
251- Y.lp.registry.pillar.activate_collapsible_div();
252- },
253- window);
254- });
255- "></script>
256 </tal:head-epilogue>
257 </head>
258