Lines Matching refs:page

7  * PageListView manages page list, dot list, switcher buttons and handles apps
38 * The 'page-list' element.
44 * A list of all 'tile-page' elements.
50 * A list of all 'apps-page' elements.
56 * The Suggestions page.
62 * The Most Visited page.
89 * The type of page that is currently shown. The value is a numerical ID.
95 * The index of the page that is currently shown, within the page type.
96 * For example if the third Apps page is showing, this will be 2.
102 * EventTracker for managing event listeners for page events.
110 * the page and run the new tile animation.
116 * Initializes page list view.
119 * represents a page.
123 * @param {!Element|undefined} opt_pageSwitcherStart Optional start page
125 * @param {!Element|undefined} opt_pageSwitcherEnd Optional end page
156 // No apps page.
167 this.tilePages = this.pageList.getElementsByClassName('tile-page');
168 this.appsPages = this.pageList.getElementsByClassName('apps-page');
185 // events on the page switchers will still scroll the page.
217 * Appends a tile page.
219 * @param {TilePage} page The page element.
220 * @param {string} title The title of the tile page.
224 * When opt_refNode is falsey, |page| will just be appended to the end of
225 * the page list.
227 appendTilePage: function(page, title, titleIsEditable, opt_refNode) {
230 this.cardSlider.addCardAtIndex(page, refIndex);
232 this.cardSlider.appendCard(page);
237 page instanceof ntp.MostVisitedPage) {
239 'MostVisitedPage should be added as first tile page');
240 this.mostVisitedPage = page;
244 page instanceof ntp.SuggestionsPage) {
245 this.suggestionsPage = page;
248 // If we're appending an AppsPage and it's a temporary page, animate it.
249 var animate = page instanceof ntp.AppsPage &&
250 page.classList.contains('temporary');
252 var newDot = new ntp.NavDot(page, title, titleIsEditable, animate);
253 page.navigationDot = newDot;
260 this.eventTracker.add(page, 'pagelayout', this.onPageLayout_.bind(this));
265 * @param {Object} appData The data for the app. This contains page and
285 * @param {boolean} fromPage True if the removal was from the current page.
300 * @return {boolean} If the page is still starting up.
339 // uninstall. Could we re-use the existing page and dot elements? It
348 // Get a list of page names
388 // Confirm that appsPages is a live object, updated when a new page is
391 'expected new page');
407 // Tell the slider about the pages and mark the current page.
445 var page = this.appsPages[pageIndex];
450 page.insertAndHighlightApp(appData);
454 page.insertApp(appData, false);
488 * Updates the hidden state of the app launcher promo based on the page
498 * Invoked whenever the pages in apps-page-list have changed so that
509 // an page with apps only (e.g., chrome://apps) or one with only the most
511 // most visited first when previously shown page is not availabel anymore.
561 var tempPage = document.querySelector('.tile-page.temporary');
593 * Adjusts the size and position of the page switchers according to the
595 * the page switchers.
601 var page = this.cardSlider.currentCardValue;
603 this.pageSwitcherStart.hidden = !page ||
605 this.pageSwitcherEnd.hidden = !page ||
608 if (!page)
615 var scrollbarWidth = page.scrollbarWidth;
617 (page.sideMargin + 13) + 'px';
620 (page.sideMargin - scrollbarWidth + 13) + 'px';
623 var offsetTop = page.querySelector('.tile-page-content').offsetTop + 'px';
629 // Update the aria-label attributes of the two page switchers.
635 * Returns the index of the given apps page.
636 * @param {AppsPage} page The AppsPage we wish to find.
637 * @return {number} The index of |page| or -1 if it is not in the
640 getAppsPageIndex: function(page) {
641 return Array.prototype.indexOf.call(this.appsPages, page);
650 var page = e.cardSlider.currentCardValue;
652 // Don't change shownPage until startup is done (and page changes actually
655 if (page.classList.contains('apps-page')) {
657 this.getAppsPageIndex(page));
658 } else if (page.classList.contains('most-visited-page')) {
661 } else if (page.classList.contains('suggestions-page')) {
664 console.error('unknown page selected');
672 page.navigationDot.classList.add('selected');
677 * Saves/updates the newly selected page to open when first loading the NTP.
678 * @type {number} shownPage The new shown page type.
679 * @type {number} shownPageIndex The new shown page index.
691 * Listen for card additions to update the page switchers or the current
703 * Listen for card removals to update the page switchers or the current card
726 * Save the name of an apps page.
727 * Store the apps page name into the preferences store.
728 * @param {AppsPage} appsPage The app page for which we wish to save.
729 * @param {string} name The name of the page.
762 * Handler for key events on the page. Ctrl-Arrow will switch the visible
763 * page.
788 * Returns the index of a given tile page.
789 * @param {TilePage} page The TilePage we wish to find.
790 * @return {number} The index of |page| or -1 if it is not in the
793 getTilePageIndex: function(page) {
794 return Array.prototype.indexOf.call(this.tilePages, page);
798 * Removes a page and navigation dot (if the navdot exists).
799 * @param {TilePage} page The page to be removed.
802 removeTilePageAndDot_: function(page, opt_animate) {
803 if (page.navigationDot)
804 page.navigationDot.remove(opt_animate);
805 this.cardSlider.removeCard(page);