Merge lp:~daker/ubuntu-html5-theme/fix.1240682 into lp:~ubuntu-html5-theme-devs/ubuntu-html5-theme/ambiance
- fix.1240682
- Merge into ambiance
Proposed by
Adnane Belmadiaf
Status: | Merged |
---|---|
Approved by: | Kyle Nitzsche |
Approved revision: | 89 |
Merged at revision: | 89 |
Proposed branch: | lp:~daker/ubuntu-html5-theme/fix.1240682 |
Merge into: | lp:~ubuntu-html5-theme-devs/ubuntu-html5-theme/ambiance |
Diff against target: |
549 lines (+231/-233) 3 files modified
0.1/ambiance/js/buttons.js (+9/-9) 0.1/ambiance/js/list.js (+132/-134) 0.1/ambiance/js/pagestacks.js (+90/-90) |
To merge this branch: | bzr merge lp:~daker/ubuntu-html5-theme/fix.1240682 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Kyle Nitzsche | Needs Fixing | ||
Ubuntu HTML5 Theme Developers | Pending | ||
Review via email: mp+191900@code.launchpad.net |
Commit message
Space instead of tab
Description of the change
To post a comment you must log in.
- 89. By Adnane Belmadiaf
-
Fixed list.js
Revision history for this message
Kyle Nitzsche (knitzsche) wrote : | # |
thanks
Revision history for this message
PS Jenkins bot (ps-jenkins) : | # |
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '0.1/ambiance/js/buttons.js' | |||
2 | --- 0.1/ambiance/js/buttons.js 2013-10-03 21:36:44 +0000 | |||
3 | +++ 0.1/ambiance/js/buttons.js 2013-10-30 20:52:23 +0000 | |||
4 | @@ -5,18 +5,18 @@ | |||
5 | 5 | * This file is part of ubuntu-html5-theme. | 5 | * This file is part of ubuntu-html5-theme. |
6 | 6 | * | 6 | * |
7 | 7 | * This package is free software; you can redistribute it and/or modify | 7 | * This package is free software; you can redistribute it and/or modify |
10 | 8 | * it under the terms of the GNU Lesser General Public License as | 8 | * it under the terms of the GNU Lesser General Public License as |
11 | 9 | * published by the Free Software Foundation; either version 3 of the | 9 | * published by the Free Software Foundation; either version 3 of the |
12 | 10 | * License, or | 10 | * License, or |
13 | 11 | * (at your option) any later version. | 11 | * (at your option) any later version. |
15 | 12 | 12 | ||
16 | 13 | * This package is distributed in the hope that it will be useful, | 13 | * This package is distributed in the hope that it will be useful, |
17 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 | 16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
23 | 17 | 17 | ||
24 | 18 | * You should have received a copy of the GNU Lesser General Public | 18 | * You should have received a copy of the GNU Lesser General Public |
25 | 19 | * License along with this program. If not, see | 19 | * License along with this program. If not, see |
26 | 20 | * <http://www.gnu.org/licenses/>. | 20 | * <http://www.gnu.org/licenses/>. |
27 | 21 | */ | 21 | */ |
28 | 22 | 22 | ||
29 | @@ -27,9 +27,9 @@ | |||
30 | 27 | 27 | ||
31 | 28 | Button.prototype = { | 28 | Button.prototype = { |
32 | 29 | click: function (callback) { | 29 | click: function (callback) { |
36 | 30 | if ( ! document.getElementById(this.id)) { | 30 | if ( ! document.getElementById(this.id)) { |
37 | 31 | throw "Invalid button ID: " + String(this.id); | 31 | throw "Invalid button ID: " + String(this.id); |
38 | 32 | } | 32 | } |
39 | 33 | new FastButton(document.getElementById(this.id), callback); | 33 | new FastButton(document.getElementById(this.id), callback); |
40 | 34 | } | 34 | } |
41 | 35 | }; | 35 | }; |
42 | 36 | 36 | ||
43 | === modified file '0.1/ambiance/js/list.js' | |||
44 | --- 0.1/ambiance/js/list.js 2013-10-21 14:02:06 +0000 | |||
45 | +++ 0.1/ambiance/js/list.js 2013-10-30 20:52:23 +0000 | |||
46 | @@ -5,18 +5,18 @@ | |||
47 | 5 | * This file is part of ubuntu-html5-theme. | 5 | * This file is part of ubuntu-html5-theme. |
48 | 6 | * | 6 | * |
49 | 7 | * This package is free software; you can redistribute it and/or modify | 7 | * This package is free software; you can redistribute it and/or modify |
52 | 8 | * it under the terms of the GNU Lesser General Public License as | 8 | * it under the terms of the GNU Lesser General Public License as |
53 | 9 | * published by the Free Software Foundation; either version 3 of the | 9 | * published by the Free Software Foundation; either version 3 of the |
54 | 10 | * License, or | 10 | * License, or |
55 | 11 | * (at your option) any later version. | 11 | * (at your option) any later version. |
57 | 12 | 12 | ||
58 | 13 | * This package is distributed in the hope that it will be useful, | 13 | * This package is distributed in the hope that it will be useful, |
59 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
60 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
61 | 16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
65 | 17 | 17 | ||
66 | 18 | * You should have received a copy of the GNU Lesser General Public | 18 | * You should have received a copy of the GNU Lesser General Public |
67 | 19 | * License along with this program. If not, see | 19 | * License along with this program. If not, see |
68 | 20 | * <http://www.gnu.org/licenses/>. | 20 | * <http://www.gnu.org/licenses/>. |
69 | 21 | */ | 21 | */ |
70 | 22 | 22 | ||
71 | @@ -24,142 +24,140 @@ | |||
72 | 24 | var List = (function () { | 24 | var List = (function () { |
73 | 25 | var LIST_DATA_ROLE = 'list'; | 25 | var LIST_DATA_ROLE = 'list'; |
74 | 26 | 26 | ||
83 | 27 | var __addUlIfNotFound = function(list) { | 27 | var __addUlIfNotFound = function (list) { |
84 | 28 | if (list) { | 28 | if (list) { |
85 | 29 | var uls = list.querySelectorAll('ul'); | 29 | var uls = list.querySelectorAll('ul'); |
86 | 30 | if (uls == null || uls.length == 0) { | 30 | if (uls == null || uls.length == 0) { |
87 | 31 | var ul = document.createElement('ul'); | 31 | var ul = document.createElement('ul'); |
88 | 32 | list.appendChild(ul); | 32 | list.appendChild(ul); |
89 | 33 | } | 33 | } |
90 | 34 | } | 34 | } |
91 | 35 | }; | 35 | }; |
92 | 36 | 36 | ||
93 | 37 | var List = function (selector) { | 37 | var List = function (selector) { |
99 | 38 | var list = document.querySelector(selector); | 38 | var list = document.querySelector(selector); |
100 | 39 | if (list == null || list.nodeName.toLowerCase() !== 'section' || list.getAttribute('data-role') != LIST_DATA_ROLE) { | 39 | if (list == null || list.nodeName.toLowerCase() !== 'section' || list.getAttribute('data-role') != LIST_DATA_ROLE) { |
101 | 40 | throw new Error('Element with selector "' + selector + '" does not exist or not declared as a "list" <section>'); | 40 | throw new Error('Element with selector "' + selector + '" does not exist or not declared as a "list" <section>'); |
102 | 41 | } | 41 | } |
103 | 42 | this._list = list; | 42 | this._list = list; |
104 | 43 | 43 | ||
106 | 44 | __addUlIfNotFound(this._list); | 44 | __addUlIfNotFound(this._list); |
107 | 45 | }; | 45 | }; |
108 | 46 | 46 | ||
109 | 47 | List.prototype = { | 47 | List.prototype = { |
141 | 48 | setHeader: function (text) { | 48 | setHeader: function (text) { |
142 | 49 | if (typeof(text) == 'string') { | 49 | if (typeof (text) == 'string') { |
143 | 50 | var header = this._list.querySelectorAll('header'); | 50 | var header = this._list.querySelectorAll('header'); |
144 | 51 | if (header) { | 51 | if (header) { |
145 | 52 | if (header.length > 1) { | 52 | if (header.length > 1) { |
146 | 53 | // more than one <header> detected | 53 | // more than one <header> detected |
147 | 54 | throw new Error("More than one <header> tag detected"); | 54 | throw new Error("More than one <header> tag detected"); |
148 | 55 | } | 55 | } |
149 | 56 | if (header.length == 1) | 56 | if (header.length == 1) |
150 | 57 | header = header[0]; | 57 | header = header[0]; |
151 | 58 | else | 58 | else |
152 | 59 | header = null; | 59 | header = null; |
153 | 60 | } | 60 | } |
154 | 61 | 61 | ||
155 | 62 | if (!header) | 62 | if (!header) |
156 | 63 | header = document.createElement('header'); | 63 | header = document.createElement('header'); |
157 | 64 | 64 | ||
158 | 65 | header.innerText = text; | 65 | header.innerText = text; |
159 | 66 | } | 66 | } |
160 | 67 | }, | 67 | }, |
161 | 68 | /* | 68 | /* |
162 | 69 | \brief Appends a item to the list | 69 | \brief Appends a item to the list |
163 | 70 | 70 | ||
164 | 71 | Appends a given item to the current list. | 71 | Appends a given item to the current list. |
165 | 72 | 72 | ||
166 | 73 | \param text A string of text (images & custom html not supported at the moment) | 73 | \param text A string of text (images & custom html not supported at the moment) |
167 | 74 | \param onclick (optional) A function callback that is to be called when the item is clicked. | 74 | \param onclick (optional) A function callback that is to be called when the item is clicked. |
168 | 75 | It will be called with the clicked node as a parameter along with the value of | 75 | It will be called with the clicked node as a parameter along with the value of |
169 | 76 | user_data (if any). | 76 | user_data (if any). |
170 | 77 | \param id (optional) An optional Id for the added node, the id will only be added if it does not already | 77 | \param id (optional) An optional Id for the added node, the id will only be added if it does not already |
171 | 78 | conflict with another one. | 78 | conflict with another one. |
172 | 79 | \param user_data (optional) An javascript entity that will be passed to the onclick callback (if any) | 79 | \param user_data (optional) An javascript entity that will be passed to the onclick callback (if any) |
253 | 80 | when the event has been trigger. | 80 | when the event has been trigger. |
254 | 81 | \return added item node or null | 81 | \return added item node or null |
255 | 82 | */ | 82 | */ |
256 | 83 | append: function (text, label, id, onclick, user_data) { | 83 | append: function (text, label, id, onclick, user_data) { |
257 | 84 | var li = document.createElement('li'); | 84 | var li = document.createElement('li'); |
258 | 85 | var a = document.createElement('a'); | 85 | var a = document.createElement('a'); |
259 | 86 | 86 | ||
260 | 87 | a.setAttribute('href', '#'); | 87 | a.setAttribute('href', '#'); |
261 | 88 | if (onclick && typeof(onclick) == 'function') { | 88 | if (onclick && typeof (onclick) == 'function') { |
262 | 89 | li.addEventListener('click', function(event) { | 89 | li.addEventListener('click', function (event) { |
263 | 90 | onclick(event ? event.target : null, user_data); | 90 | onclick(event ? event.target : null, user_data); |
264 | 91 | if (event) | 91 | if (event) |
265 | 92 | event.preventDefault(); | 92 | event.preventDefault(); |
266 | 93 | }); | 93 | }); |
267 | 94 | } | 94 | } |
268 | 95 | //FIXME: no real checks on text content | 95 | //FIXME: no real checks on text content |
269 | 96 | a.innerText = text; | 96 | a.innerText = text; |
270 | 97 | li.appendChild(a); | 97 | li.appendChild(a); |
271 | 98 | 98 | ||
272 | 99 | if (label && typeof(label) == 'string') { | 99 | if (label && typeof (label) == 'string') { |
273 | 100 | var n = document.createElement('label'); | 100 | var n = document.createElement('label'); |
274 | 101 | n.innerText = label; | 101 | n.innerText = label; |
275 | 102 | li.appendChild(n); | 102 | li.appendChild(n); |
276 | 103 | } | 103 | } |
277 | 104 | 104 | ||
278 | 105 | if (id && typeof(id) == 'string') { | 105 | if (id && typeof (id) == 'string') { |
279 | 106 | if ( ! document.getElementById(id)) | 106 | if (!document.getElementById(id)) |
280 | 107 | li.setAttribute('id', id); | 107 | li.setAttribute('id', id); |
281 | 108 | } | 108 | } |
282 | 109 | this._list.querySelector('ul').appendChild(li); | 109 | this._list.querySelector('ul').appendChild(li); |
283 | 110 | 110 | ||
284 | 111 | return li; | 111 | return li; |
285 | 112 | }, | 112 | }, |
286 | 113 | /* | 113 | /* |
287 | 114 | \brief returns the nth child item from a list | 114 | \brief returns the nth child item from a list |
288 | 115 | 115 | ||
289 | 116 | \param index Index of the child to return (0 based number) | 116 | \param index Index of the child to return (0 based number) |
290 | 117 | \return selected item node or null | 117 | \return selected item node or null |
291 | 118 | */ | 118 | */ |
292 | 119 | at: function (index) { | 119 | at: function (index) { |
293 | 120 | if (typeof(index) != 'number') | 120 | if (typeof (index) != 'number') |
294 | 121 | return null; | 121 | return null; |
295 | 122 | return this._list.querySelector('ul').querySelector('li:nth-child(' + index + ')'); | 122 | return this._list.querySelector('ul').querySelector('li:nth-child(' + index + ')'); |
296 | 123 | }, | 123 | }, |
297 | 124 | /* | 124 | /* |
298 | 125 | \brief removes the nth child item from a list | 125 | \brief removes the nth child item from a list |
299 | 126 | 126 | ||
300 | 127 | \param index Index of the child to remove (0 based number) | 127 | \param index Index of the child to remove (0 based number) |
301 | 128 | \return nothing | 128 | \return nothing |
302 | 129 | */ | 129 | */ |
303 | 130 | remove: function (index) { | 130 | remove: function (index) { |
304 | 131 | var item = this.at(index); | 131 | var item = this.at(index); |
305 | 132 | if (item) { | 132 | if (item) { |
306 | 133 | item.parentNode.removeChild(item); | 133 | item.parentNode.removeChild(item); |
307 | 134 | } | 134 | } |
308 | 135 | }, | 135 | }, |
309 | 136 | /* | 136 | /* |
310 | 137 | \brief removes all the child items from a list | 137 | \brief removes all the child items from a list |
311 | 138 | \return nothing | 138 | \return nothing |
312 | 139 | */ | 139 | */ |
313 | 140 | removeAllItems: function() { | 140 | removeAllItems: function () { |
314 | 141 | if (this._list.querySelector('ul')) | 141 | if (this._list.querySelector('ul')) |
315 | 142 | this._list.querySelector('ul').innerHTML = ''; | 142 | this._list.querySelector('ul').innerHTML = ''; |
316 | 143 | }, | 143 | }, |
317 | 144 | /* | 144 | /* |
318 | 145 | \brief iterator over the list of list items and calls a function on each one | 145 | \brief iterator over the list of list items and calls a function on each one |
319 | 146 | 146 | ||
320 | 147 | \param func function to be called for each list item. The function | 147 | \param func function to be called for each list item. The function |
321 | 148 | receives the DOM node associated with the current item along with its | 148 | receives the DOM node associated with the current item along with its |
322 | 149 | index. | 149 | index. |
323 | 150 | \return nothing | 150 | \return nothing |
324 | 151 | */ | 151 | */ |
325 | 152 | forEach: function (func) { | 152 | forEach: function (func) { |
326 | 153 | if (typeof(func) !== 'function') | 153 | if (typeof (func) !== 'function') |
327 | 154 | return; | 154 | return; |
328 | 155 | var items = this._list.querySelector('ul').querySelectorAll('li'); | 155 | var items = this._list.querySelector('ul').querySelectorAll('li'); |
329 | 156 | Array.prototype.forEach.call(items, function (element, index) { | 156 | Array.prototype.forEach.call(items, function (element, index) { |
330 | 157 | func(element, index); | 157 | func(element, index); |
331 | 158 | }); | 158 | }); |
332 | 159 | }, | 159 | }, |
333 | 160 | }; | 160 | }; |
334 | 161 | 161 | ||
335 | 162 | return List; | 162 | return List; |
339 | 163 | }) (); | 163 | })(); |
337 | 164 | |||
338 | 165 | |||
340 | 166 | \ No newline at end of file | 164 | \ No newline at end of file |
341 | 167 | 165 | ||
342 | === modified file '0.1/ambiance/js/pagestacks.js' | |||
343 | --- 0.1/ambiance/js/pagestacks.js 2013-07-19 00:08:53 +0000 | |||
344 | +++ 0.1/ambiance/js/pagestacks.js 2013-10-30 20:52:23 +0000 | |||
345 | @@ -5,113 +5,113 @@ | |||
346 | 5 | * This file is part of ubuntu-html5-theme. | 5 | * This file is part of ubuntu-html5-theme. |
347 | 6 | * | 6 | * |
348 | 7 | * This package is free software; you can redistribute it and/or modify | 7 | * This package is free software; you can redistribute it and/or modify |
351 | 8 | * it under the terms of the GNU Lesser General Public License as | 8 | * it under the terms of the GNU Lesser General Public License as |
352 | 9 | * published by the Free Software Foundation; either version 3 of the | 9 | * published by the Free Software Foundation; either version 3 of the |
353 | 10 | * License, or | 10 | * License, or |
354 | 11 | * (at your option) any later version. | 11 | * (at your option) any later version. |
356 | 12 | 12 | ||
357 | 13 | * This package is distributed in the hope that it will be useful, | 13 | * This package is distributed in the hope that it will be useful, |
358 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
359 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
360 | 16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. |
364 | 17 | 17 | ||
365 | 18 | * You should have received a copy of the GNU Lesser General Public | 18 | * You should have received a copy of the GNU Lesser General Public |
366 | 19 | * License along with this program. If not, see | 19 | * License along with this program. If not, see |
367 | 20 | * <http://www.gnu.org/licenses/>. | 20 | * <http://www.gnu.org/licenses/>. |
368 | 21 | */ | 21 | */ |
369 | 22 | 22 | ||
370 | 23 | /* Pagestack */ | 23 | /* Pagestack */ |
371 | 24 | |||
372 | 24 | var Pagestack = (function () { | 25 | var Pagestack = (function () { |
374 | 25 | 26 | ||
375 | 26 | function __safeCall(f, args, errorfunc) { | 27 | function __safeCall(f, args, errorfunc) { |
382 | 27 | if (typeof(f) !== 'function') | 28 | if (typeof (f) !== 'function') |
383 | 28 | return; | 29 | return; |
384 | 29 | try { | 30 | try { |
385 | 30 | f.apply(null, args); | 31 | f.apply(null, args); |
386 | 31 | } | 32 | } catch (e) { |
387 | 32 | catch(e) { if (errorfunc && typeof(errorfunc) === 'function') errorfunc(e) } | 33 | if (errorfunc && typeof (errorfunc) === 'function') errorfunc(e) |
388 | 34 | } | ||
389 | 33 | }; | 35 | }; |
390 | 34 | 36 | ||
393 | 35 | function Pagestack () { | 37 | function Pagestack() { |
394 | 36 | this._pages = []; | 38 | this._pages = []; |
395 | 37 | }; | 39 | }; |
396 | 38 | 40 | ||
397 | 39 | Pagestack.prototype = { | 41 | Pagestack.prototype = { |
471 | 40 | __setAllPagesVisibility: function (visible) { | 42 | __setAllPagesVisibility: function (visible) { |
472 | 41 | var visibility = visible ? "block" : "none"; | 43 | var visibility = visible ? "block" : "none"; |
473 | 42 | [].forEach.call(document.querySelectorAll("[data-role='pagestack'] [data-role='page']"), function(el) { | 44 | [].forEach.call(document.querySelectorAll("[data-role='pagestack'] [data-role='page']"), function (el) { |
474 | 43 | el.style.display = visibility; | 45 | el.style.display = visibility; |
475 | 44 | 46 | ||
476 | 45 | // treat footers separately | 47 | // treat footers separately |
477 | 46 | var footer = el.querySelector('footer'); | 48 | var footer = el.querySelector('footer'); |
478 | 47 | if (footer) | 49 | if (footer) |
479 | 48 | footer.style.display = visibility; | 50 | footer.style.display = visibility; |
480 | 49 | }); | 51 | }); |
481 | 50 | }, | 52 | }, |
482 | 51 | __isPage: function (element) { | 53 | __isPage: function (element) { |
483 | 52 | return element.getAttribute('data-role') === 'page'; | 54 | return element.getAttribute('data-role') === 'page'; |
484 | 53 | }, | 55 | }, |
485 | 54 | __deactivate: function (id) { | 56 | __deactivate: function (id) { |
486 | 55 | if (!id || typeof(id) !== 'string') | 57 | if (!id || typeof (id) !== 'string') |
487 | 56 | return; | 58 | return; |
488 | 57 | var page = document.getElementById(id); | 59 | var page = document.getElementById(id); |
489 | 58 | if ( ! this.__isPage(page)) { | 60 | if (!this.__isPage(page)) { |
490 | 59 | return; | 61 | return; |
491 | 60 | } | 62 | } |
492 | 61 | page.style.display = "none"; | 63 | page.style.display = "none"; |
493 | 62 | if (page.querySelector('footer')) { | 64 | if (page.querySelector('footer')) { |
494 | 63 | var footer = page.querySelector('footer'); | 65 | var footer = page.querySelector('footer'); |
495 | 64 | footer.style.display = 'none'; | 66 | footer.style.display = 'none'; |
496 | 65 | footer.classList.remove('revealed'); | 67 | footer.classList.remove('revealed'); |
497 | 66 | } | 68 | } |
498 | 67 | }, | 69 | }, |
499 | 68 | __activate: function (id) { | 70 | __activate: function (id) { |
500 | 69 | if (!id || typeof(id) !== 'string') | 71 | if (!id || typeof (id) !== 'string') |
501 | 70 | return; | 72 | return; |
502 | 71 | var page = document.getElementById(id); | 73 | var page = document.getElementById(id); |
503 | 72 | if ( ! this.__isPage(page)) { | 74 | if (!this.__isPage(page)) { |
504 | 73 | return; | 75 | return; |
505 | 74 | } | 76 | } |
506 | 75 | page.style.display = "block"; | 77 | page.style.display = "block"; |
507 | 76 | if (page.querySelector('footer')) { | 78 | if (page.querySelector('footer')) { |
508 | 77 | var footer = page.querySelector('footer'); | 79 | var footer = page.querySelector('footer'); |
509 | 78 | footer.style.display = 'block'; | 80 | footer.style.display = 'block'; |
510 | 79 | footer.classList.add('revealed'); | 81 | footer.classList.add('revealed'); |
511 | 80 | } | 82 | } |
512 | 81 | }, | 83 | }, |
513 | 82 | push: function (id, properties) { | 84 | push: function (id, properties) { |
514 | 83 | try { | 85 | try { |
515 | 84 | __safeCall(this.__setAllPagesVisibility.bind(this), [false]); | 86 | __safeCall(this.__setAllPagesVisibility.bind(this), [false]); |
516 | 85 | 87 | ||
517 | 86 | this.__activate(id); | 88 | this.__activate(id); |
518 | 87 | this._pages.push(id); | 89 | this._pages.push(id); |
519 | 88 | } | 90 | } catch (e) {} |
520 | 89 | catch(e) {} | 91 | }, |
521 | 90 | }, | 92 | isEmpty: function () { |
522 | 91 | isEmpty: function () { | 93 | return this._pages.length === 0; |
523 | 92 | return this._pages.length === 0; | 94 | }, |
524 | 93 | }, | 95 | currentPage: function () { |
525 | 94 | currentPage: function () { | 96 | return this.isEmpty() ? null : this._pages[this._pages.length - 1]; |
526 | 95 | return this.isEmpty() ? null : this._pages[this._pages.length-1]; | 97 | }, |
527 | 96 | }, | 98 | depth: function () { |
528 | 97 | depth: function() { | 99 | return this._pages.length; |
529 | 98 | return this._pages.length; | 100 | }, |
530 | 99 | }, | 101 | clear: function () { |
531 | 100 | clear: function() { | 102 | if (this.isEmpty()) |
532 | 101 | if (this.isEmpty()) | 103 | return; |
533 | 102 | return; | 104 | __safeCall(this.__deactivate.bind(this), [this.currentPage()]); |
534 | 103 | __safeCall(this.__deactivate.bind(this), [this.currentPage()]); | 105 | this._pages = []; |
535 | 104 | this._pages = []; | 106 | }, |
536 | 105 | }, | 107 | pop: function () { |
537 | 106 | pop: function() { | 108 | if (this.isEmpty()) |
538 | 107 | if(this.isEmpty()) | 109 | return; |
539 | 108 | return; | 110 | __safeCall(this.__deactivate.bind(this), [this.currentPage()]); |
540 | 109 | __safeCall(this.__deactivate.bind(this), [this.currentPage()]); | 111 | this._pages.pop(); |
541 | 110 | this._pages.pop(); | 112 | __safeCall(this.__activate.bind(this), [this.currentPage()]); |
542 | 111 | __safeCall(this.__activate.bind(this), [this.currentPage()]); | 113 | } |
470 | 112 | } | ||
543 | 113 | } | 114 | } |
544 | 114 | 115 | ||
545 | 115 | return Pagestack; | 116 | return Pagestack; |
548 | 116 | })(); | 117 | })(); |
547 | 117 | |||
549 | 118 | \ No newline at end of file | 118 | \ No newline at end of file |
Hi Adnane: I think list.js still uses tabs.