Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/resources/options/import_data_overlay.js

Issue 6378006: Add Throbber control for DOMUI. Use it everywhere in options and in Sync setup UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed nit Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 cr.define('options', function() { 5 cr.define('options', function() {
6 6
7 var OptionsPage = options.OptionsPage; 7 var OptionsPage = options.OptionsPage;
8 8
9 /** 9 /**
10 * ImportDataOverlay class 10 * ImportDataOverlay class
11 * Encapsulated handling of the 'Import Data' overlay page. 11 * Encapsulated handling of the 'Import Data' overlay page.
12 * @class 12 * @class
13 */ 13 */
14 function ImportDataOverlay() { 14 function ImportDataOverlay() {
15 OptionsPage.call(this, 15 OptionsPage.call(this,
16 'importDataOverlay', 16 'importDataOverlay',
17 templateData.import_data_title, 17 templateData.import_data_title,
18 'import-data-overlay'); 18 'import-data-overlay');
19 } 19 }
20 20
21 ImportDataOverlay.throbIntervalId = 0;
22
23 cr.addSingletonGetter(ImportDataOverlay); 21 cr.addSingletonGetter(ImportDataOverlay);
24 22
25 ImportDataOverlay.prototype = { 23 ImportDataOverlay.prototype = {
26 // Inherit from OptionsPage. 24 // Inherit from OptionsPage.
27 __proto__: OptionsPage.prototype, 25 __proto__: OptionsPage.prototype,
28 26
29 /** 27 /**
30 * Initialize the page. 28 * Initialize the page.
31 */ 29 */
32 initializePage: function() { 30 initializePage: function() {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 document.querySelectorAll('#import-checkboxes input[type=checkbox]'); 159 document.querySelectorAll('#import-checkboxes input[type=checkbox]');
162 for (var i = 0; i < checkboxes.length; i++) { 160 for (var i = 0; i < checkboxes.length; i++) {
163 checkboxes[i].disabled = true; 161 checkboxes[i].disabled = true;
164 } 162 }
165 } else { 163 } else {
166 ImportDataOverlay.getInstance().updateCheckboxes_(); 164 ImportDataOverlay.getInstance().updateCheckboxes_();
167 } 165 }
168 $('import-browsers').disabled = state; 166 $('import-browsers').disabled = state;
169 $('import-data-commit').disabled = state; 167 $('import-data-commit').disabled = state;
170 $('import-throbber').style.visibility = state ? "visible" : "hidden"; 168 $('import-throbber').style.visibility = state ? "visible" : "hidden";
171
172 function advanceThrobber() {
173 var throbber = $('import-throbber');
174 throbber.style.backgroundPositionX =
175 ((parseInt(getComputedStyle(throbber).backgroundPositionX, 10) - 16)
176 % 576) + 'px';
177 }
178 if (state) {
179 ImportDataOverlay.throbIntervalId = setInterval(advanceThrobber, 30);
180 } else {
181 clearInterval(ImportDataOverlay.throbIntervalId);
182 }
183 }; 169 };
184 170
185 /** 171 /**
186 * Remove the import overlay from display. 172 * Remove the import overlay from display.
187 */ 173 */
188 ImportDataOverlay.dismiss = function() { 174 ImportDataOverlay.dismiss = function() {
189 ImportDataOverlay.setImportingState(false); 175 ImportDataOverlay.setImportingState(false);
190 OptionsPage.clearOverlays(); 176 OptionsPage.clearOverlays();
191 } 177 }
192 178
193 // Export 179 // Export
194 return { 180 return {
195 ImportDataOverlay: ImportDataOverlay 181 ImportDataOverlay: ImportDataOverlay
196 }; 182 };
197 183
198 }); 184 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/import_data_overlay.html ('k') | chrome/browser/resources/options/options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698