| Index: chrome/browser/resources/feedback.js
|
| diff --git a/chrome/browser/resources/feedback.js b/chrome/browser/resources/feedback.js
|
| index d2cba0895457955bcc7f2ad29f2f520efb3c3a2e..2c388c404be8c1a86c8bd19bf6e396d8aa7ea268 100644
|
| --- a/chrome/browser/resources/feedback.js
|
| +++ b/chrome/browser/resources/feedback.js
|
| @@ -16,8 +16,6 @@ savedThumbnailIds['saved-screenshots'] = '';
|
|
|
| var categoryTag = '';
|
|
|
| -var localStrings = new LocalStrings();
|
| -
|
| /**
|
| * Selects an image thumbnail in the specified div.
|
| * @param {string} divId The id of the div to search in.
|
| @@ -30,15 +28,16 @@ function selectImage(divId, thumbnailId) {
|
| $(divId).hidden = true;
|
| return;
|
| }
|
| +
|
| for (var i = 0; i < thumbnailDivs.length; i++) {
|
| + thumbnailDivs[i].className = 'image-thumbnail-container';
|
| +
|
| // If the the current div matches the thumbnail id provided,
|
| // or there is no thumbnail id given, and we're at the first thumbnail.
|
| - if ((thumbnailDivs[i].id == thumbnailId) || (!thumbnailId && !i)) {
|
| - thumbnailDivs[i].className = 'image-thumbnail-container-selected';
|
| + if (thumbnailDivs[i].id == thumbnailId || (!thumbnailId && !i)) {
|
| + thumbnailDivs[i].classList.add('image-thumbnail-container-selected');
|
| selectedThumbnailId = thumbnailId;
|
| savedThumbnailIds[divId] = thumbnailId;
|
| - } else {
|
| - thumbnailDivs[i].className = 'image-thumbnail-container';
|
| }
|
| }
|
| }
|
| @@ -58,10 +57,7 @@ function addScreenshot(divId, screenshot) {
|
| };
|
|
|
| var innerDiv = document.createElement('div');
|
| - if (divId == 'current-screenshots')
|
| - innerDiv.className = 'image-thumbnail-current';
|
| - else
|
| - innerDiv.className = 'image-thumbnail';
|
| + innerDiv.className = 'image-thumbnail';
|
|
|
| var thumbnail = document.createElement('img');
|
| thumbnail.id = thumbnailDiv.id + '-image';
|
| @@ -97,7 +93,7 @@ function disableScreenshots() {
|
| */
|
| function sendReport() {
|
| if ($('description-text').value.length == 0) {
|
| - alert(localStrings.getString('no-description'));
|
| + alert(loadTimeData.getString('no-description'));
|
| return false;
|
| }
|
|
|
| @@ -157,19 +153,17 @@ function currentSelected() {
|
| * selected when we had this div open previously.
|
| */
|
| function savedSelected() {
|
| - $('current-screenshots').hidden = true;
|
| -
|
| if ($('saved-screenshots').childElementCount == 0) {
|
| // setupSavedScreenshots will take care of changing visibility
|
| chrome.send('refreshSavedScreenshots');
|
| } else {
|
| + $('current-screenshots').hidden = true;
|
| $('saved-screenshots').hidden = false;
|
| if (selectedThumbnailDivId != 'saved-screenshots')
|
| selectImage('saved-screenshots', savedThumbnailIds['saved-screenshots']);
|
| }
|
| }
|
|
|
| -
|
| /**
|
| * Change the type of screenshot we're showing to the user from
|
| * the current screenshot to saved screenshots
|
| @@ -267,9 +261,10 @@ function setupCurrentScreenshot(screenshot) {
|
| function setupSavedScreenshots(screenshots) {
|
| if (screenshots.length == 0) {
|
| $('saved-screenshots').textContent =
|
| - localStrings.getString('no-saved-screenshots');
|
| + loadTimeData.getString('no-saved-screenshots');
|
|
|
| // Make sure we make the display the message.
|
| + $('current-screenshots').hidden = true;
|
| $('saved-screenshots').hidden = false;
|
|
|
| // In case the user tries to send now; fail safe, do not send a screenshot
|
|
|