Chromium Code Reviews| Index: chrome/browser/resources/file_manager/js/file_manager.js |
| diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js |
| index 4663ac06478a04b9bb8ba62497debeae4d451e56..d8f9f26881b90b1d3d53aec7ab2f2ac2f0dfeb43 100644 |
| --- a/chrome/browser/resources/file_manager/js/file_manager.js |
| +++ b/chrome/browser/resources/file_manager/js/file_manager.js |
| @@ -434,6 +434,12 @@ FileManager.prototype = { |
| dirEntry.fullPath == ARCHIVE_DIRECTORY; |
| } |
| + function removeChildren(element) { |
|
arv (Not doing code reviews)
2011/11/29 22:53:27
element.textContent = '';
|
| + while (element.firstChild) { |
| + element.removeChild(element.firstChild); |
| + } |
| + }; |
| + |
| // Public statics. |
| /** |
| @@ -1828,8 +1834,8 @@ FileManager.prototype = { |
| }; |
| this.previewSummary_.textContent = str('COMPUTING_SELECTION'); |
| - this.taskButtons_.innerHTML = ''; |
| - this.previewThumbnails_.innerHTML = ''; |
| + removeChildren(this.taskButtons_); |
| + removeChildren(this.previewThumbnails_); |
| if (!selection.indexes.length) { |
| this.updateCommonActionButtons_(); |
| @@ -1913,7 +1919,7 @@ FileManager.prototype = { |
| } |
| if (this.dialogType_ == FileManager.DialogType.FULL_PAGE) { |
| - this.taskButtons_.innerHTML = ''; |
| + removeChildren(this.taskButtons_); |
| // Some internal tasks cannot be defined in terms of file patterns, |
| // so we pass selection to check for them manually. |
| if (selection.directoryCount == 0 && selection.fileCount > 0) { |
| @@ -2069,7 +2075,7 @@ FileManager.prototype = { |
| * @param {Array.<Task>} tasksList The tasks list. |
| */ |
| FileManager.prototype.onTasksFound_ = function(selection, tasksList) { |
| - this.taskButtons_.innerHTML = ''; |
| + removeChildren(this.taskButtons_); |
| for (var i = 0; i < tasksList.length; i++) { |
| var task = tasksList[i]; |
| @@ -2389,7 +2395,7 @@ FileManager.prototype = { |
| */ |
| FileManager.prototype.updateBreadcrumbs_ = function() { |
| var bc = this.dialogDom_.querySelector('.breadcrumbs'); |
| - bc.innerHTML = ''; |
| + removeChildren(bc); |
| var fullPath = this.currentDirEntry_.fullPath.replace(/\/$/, ''); |
| var pathNames = fullPath.split('/'); |