OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 function getAppsCallback(data) { | 5 function getAppsCallback(data) { |
6 logEvent('received apps'); | 6 logEvent('received apps'); |
7 var appsSection = $('apps'); | 7 var appsSection = $('apps'); |
8 var appsSectionContent = $('apps-maxiview'); | 8 var appsSectionContent = $('apps-maxiview'); |
9 var appsMiniview = appsSection.getElementsByClassName('miniview')[0]; | 9 var appsMiniview = appsSection.getElementsByClassName('miniview')[0]; |
10 appsSectionContent.textContent = ''; | 10 appsSectionContent.textContent = ''; |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 a.style.backgroundImage = url(app['icon_big']); | 158 a.style.backgroundImage = url(app['icon_big']); |
159 if (hashParams['app-id'] == app['id']) { | 159 if (hashParams['app-id'] == app['id']) { |
160 div.setAttribute('new', 'new'); | 160 div.setAttribute('new', 'new'); |
161 // Delay changing the attribute a bit to let the page settle down a bit. | 161 // Delay changing the attribute a bit to let the page settle down a bit. |
162 setTimeout(function() { | 162 setTimeout(function() { |
163 // This will trigger the 'bounce' animation defined in apps.css. | 163 // This will trigger the 'bounce' animation defined in apps.css. |
164 div.setAttribute('new', 'installed'); | 164 div.setAttribute('new', 'installed'); |
165 }, 500); | 165 }, 500); |
166 div.addEventListener('webkitAnimationEnd', function(e) { | 166 div.addEventListener('webkitAnimationEnd', function(e) { |
167 div.removeAttribute('new'); | 167 div.removeAttribute('new'); |
| 168 |
| 169 // If we get new data (eg because something installs in another tab, |
| 170 // or because we uninstall something here), don't run the install |
| 171 // animation again. |
| 172 document.documentElement.setAttribute("install-animation-enabled", |
| 173 "false"); |
168 }); | 174 }); |
169 if ($('apps').classList.contains('hidden')) | 175 if ($('apps').classList.contains('hidden')) |
170 toggleSectionVisibilityAndAnimate('APPS'); | 176 toggleSectionVisibilityAndAnimate('APPS'); |
171 } | 177 } |
172 | 178 |
173 var settingsButton = div.appendChild(new cr.ui.ContextMenuButton); | 179 var settingsButton = div.appendChild(new cr.ui.ContextMenuButton); |
174 settingsButton.className = 'app-settings'; | 180 settingsButton.className = 'app-settings'; |
175 settingsButton.title = localStrings.getString('appsettings'); | 181 settingsButton.title = localStrings.getString('appsettings'); |
176 | 182 |
177 addContextMenu(div, app); | 183 addContextMenu(div, app); |
(...skipping 20 matching lines...) Expand all Loading... |
198 | 204 |
199 createWebStoreElement: function() { | 205 createWebStoreElement: function() { |
200 return createElement({ | 206 return createElement({ |
201 'id': 'web-store-entry', | 207 'id': 'web-store-entry', |
202 'name': localStrings.getString('web_store_title'), | 208 'name': localStrings.getString('web_store_title'), |
203 'launch_url': localStrings.getString('web_store_url') | 209 'launch_url': localStrings.getString('web_store_url') |
204 }); | 210 }); |
205 } | 211 } |
206 }; | 212 }; |
207 })(); | 213 })(); |
OLD | NEW |