| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview PageListView implementation. | 6 * @fileoverview PageListView implementation. |
| 7 * PageListView manages page list, dot list, switcher buttons and handles apps | 7 * PageListView manages page list, dot list, switcher buttons and handles apps |
| 8 * pages callbacks from backend. | 8 * pages callbacks from backend. |
| 9 * | 9 * |
| 10 * Note that you need to have AppLauncherHandler in your WebUI to use this code. | 10 * Note that you need to have AppLauncherHandler in your WebUI to use this code. |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 e.preventDefault(); | 174 e.preventDefault(); |
| 175 }, true); | 175 }, true); |
| 176 | 176 |
| 177 this.tilePages = this.pageList.getElementsByClassName('tile-page'); | 177 this.tilePages = this.pageList.getElementsByClassName('tile-page'); |
| 178 this.appsPages = this.pageList.getElementsByClassName('apps-page'); | 178 this.appsPages = this.pageList.getElementsByClassName('apps-page'); |
| 179 | 179 |
| 180 // Initialize the cardSlider without any cards at the moment | 180 // Initialize the cardSlider without any cards at the moment |
| 181 this.sliderFrame = cardSliderFrame; | 181 this.sliderFrame = cardSliderFrame; |
| 182 this.cardSlider = new cr.ui.CardSlider(this.sliderFrame, this.pageList, | 182 this.cardSlider = new cr.ui.CardSlider(this.sliderFrame, this.pageList, |
| 183 this.sliderFrame.offsetWidth); | 183 this.sliderFrame.offsetWidth); |
| 184 this.cardSlider.initialize(); | 184 this.cardSlider.initialize( |
| 185 templateData.isSwipeTrackingFromScrollEventsEnabled); |
| 185 | 186 |
| 186 // Handle events from the card slider. | 187 // Handle events from the card slider. |
| 187 this.pageList.addEventListener('cardSlider:card_changed', | 188 this.pageList.addEventListener('cardSlider:card_changed', |
| 188 this.onCardChanged_.bind(this)); | 189 this.onCardChanged_.bind(this)); |
| 189 this.pageList.addEventListener('cardSlider:card_added', | 190 this.pageList.addEventListener('cardSlider:card_added', |
| 190 this.onCardAdded_.bind(this)); | 191 this.onCardAdded_.bind(this)); |
| 191 this.pageList.addEventListener('cardSlider:card_removed', | 192 this.pageList.addEventListener('cardSlider:card_removed', |
| 192 this.onCardRemoved_.bind(this)); | 193 this.onCardRemoved_.bind(this)); |
| 193 | 194 |
| 194 // Ensure the slider is resized appropriately with the window | 195 // Ensure the slider is resized appropriately with the window |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 if (page.navigationDot) | 722 if (page.navigationDot) |
| 722 page.navigationDot.remove(opt_animate); | 723 page.navigationDot.remove(opt_animate); |
| 723 this.cardSlider.removeCard(page); | 724 this.cardSlider.removeCard(page); |
| 724 }, | 725 }, |
| 725 }; | 726 }; |
| 726 | 727 |
| 727 return { | 728 return { |
| 728 PageListView: PageListView | 729 PageListView: PageListView |
| 729 }; | 730 }; |
| 730 }); | 731 }); |
| OLD | NEW |