| 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('recieved 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 = ''; |
| 11 appsMiniview.textContent = ''; | 11 appsMiniview.textContent = ''; |
| 12 | 12 |
| 13 if (data.apps.length == 0) { | 13 if (data.apps.length == 0) { |
| 14 appsSection.classList.add('disabled'); | 14 appsSection.classList.add('disabled'); |
| 15 return; | 15 return; |
| 16 } | 16 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 createElement: function(app) { | 145 createElement: function(app) { |
| 146 var div = createElement(app); | 146 var div = createElement(app); |
| 147 var a = div.firstChild; | 147 var a = div.firstChild; |
| 148 | 148 |
| 149 a.onclick = handleClick; | 149 a.onclick = handleClick; |
| 150 a.style.backgroundImage = url(app['icon_big']); | 150 a.style.backgroundImage = url(app['icon_big']); |
| 151 if (hashParams['app-id'] == app['id']) { | 151 if (hashParams['app-id'] == app['id']) { |
| 152 div.setAttribute('new', 'new'); | 152 div.setAttribute('new', 'new'); |
| 153 // Delay changing the attribute a bit to let the page settle down a bit. | 153 // Delay changing the attribute a bit to let the page settle down a bit. |
| 154 setTimeout(function() { | 154 setTimeout(function() { |
| 155 // This will trigger the 'bounce' animation defined in apps.css. |
| 155 div.setAttribute('new', 'installed'); | 156 div.setAttribute('new', 'installed'); |
| 156 }, 500); | 157 }, 500); |
| 158 div.addEventListener('webkitAnimationEnd', function(e) { |
| 159 div.removeAttribute('new'); |
| 160 }); |
| 161 if ($('apps').classList.contains('hidden')) |
| 162 toggleSectionVisibilityAndAnimate('APPS'); |
| 157 } | 163 } |
| 158 | 164 |
| 159 var settingsButton = div.appendChild(new cr.ui.ContextMenuButton); | 165 var settingsButton = div.appendChild(new cr.ui.ContextMenuButton); |
| 160 settingsButton.className = 'app-settings'; | 166 settingsButton.className = 'app-settings'; |
| 161 settingsButton.title = localStrings.getString('appsettings'); | 167 settingsButton.title = localStrings.getString('appsettings'); |
| 162 | 168 |
| 163 addContextMenu(div, app); | 169 addContextMenu(div, app); |
| 164 | 170 |
| 165 return div; | 171 return div; |
| 166 }, | 172 }, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 184 | 190 |
| 185 createWebStoreElement: function() { | 191 createWebStoreElement: function() { |
| 186 return createElement({ | 192 return createElement({ |
| 187 'id': 'web-store-entry', | 193 'id': 'web-store-entry', |
| 188 'name': localStrings.getString('web_store_title'), | 194 'name': localStrings.getString('web_store_title'), |
| 189 'launch_url': localStrings.getString('web_store_url') | 195 'launch_url': localStrings.getString('web_store_url') |
| 190 }); | 196 }); |
| 191 } | 197 } |
| 192 }; | 198 }; |
| 193 })(); | 199 })(); |
| OLD | NEW |