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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 8727028: Eliminate use of assignments to innerHTML in File Browser (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Deleted another redundant file Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/image_editor/gallery.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7c0da76a4cf58f4983c99e9dfade84d953d4c66e..b786c434d0613b4486d6a12e459626db7bb7115f 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -434,6 +434,10 @@ FileManager.prototype = {
dirEntry.fullPath == ARCHIVE_DIRECTORY;
}
+ function removeChildren(element) {
+ element.textContent = '';
+ };
+
// Public statics.
/**
@@ -1828,8 +1832,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 +1917,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 +2073,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 +2393,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('/');
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/image_editor/gallery.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698