summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-03 20:10:34 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-03 20:10:34 +0000
commit29c4e6f6990be263a6e8db263c135d73e2e43f6e (patch)
tree68232996e902010958d29dede68009bb53175053
parentabedace08caf6de4481666b1ae3326561e833155 (diff)
downloadchromium_src-29c4e6f6990be263a6e8db263c135d73e2e43f6e.zip
chromium_src-29c4e6f6990be263a6e8db263c135d73e2e43f6e.tar.gz
chromium_src-29c4e6f6990be263a6e8db263c135d73e2e43f6e.tar.bz2
fix broken cardslider when getAppsCallback is called more than once
(for example, after sync updates) BUG=117857 TEST=see bug (use multiple clients synced to the same account) Review URL: https://chromiumcodereview.appspot.com/9969086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130439 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/ntp4/apps_page.js1
-rw-r--r--chrome/browser/resources/ntp4/page_list_view.js16
2 files changed, 16 insertions, 1 deletions
diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js
index 93f9f72..52c3201 100644
--- a/chrome/browser/resources/ntp4/apps_page.js
+++ b/chrome/browser/resources/ntp4/apps_page.js
@@ -315,6 +315,7 @@ cr.define('ntp', function() {
this.appImg_.classList.remove('invisible');
this.appImgSrc_ = null;
}
+
this.classList.remove('icon-loading');
},
diff --git a/chrome/browser/resources/ntp4/page_list_view.js b/chrome/browser/resources/ntp4/page_list_view.js
index 5d7bc06..abe3e82 100644
--- a/chrome/browser/resources/ntp4/page_list_view.js
+++ b/chrome/browser/resources/ntp4/page_list_view.js
@@ -293,6 +293,13 @@ cr.define('ntp', function() {
},
/**
+ * Tracks whether apps have been loaded at least once.
+ * @type {boolean}
+ * @private
+ */
+ appsLoaded_: false,
+
+ /**
* Callback invoked by chrome with the apps available.
*
* Note that calls to this function can occur at any time, not just in
@@ -387,7 +394,14 @@ cr.define('ntp', function() {
logEvent('apps.layout: ' + (Date.now() - startTime));
- cr.dispatchSimpleEvent(document, 'sectionready', true, true);
+ // Tell the slider about the pages and mark the current page.
+ this.updateSliderCards();
+ this.cardSlider.currentCardValue.navigationDot.classList.add('selected');
+
+ if (!this.appsLoaded_) {
+ this.appsLoaded_ = true;
+ cr.dispatchSimpleEvent(document, 'sectionready', true, true);
+ }
},
/**