summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/history.js
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 14:08:00 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-09 14:08:00 +0000
commit9f39293c0507c538c944de86ca6ce002c6feb2b2 (patch)
tree47755aa650b9d3b859abd0419c6931e28bb1c358 /chrome/browser/resources/history.js
parente1af00b15acc4cb11f97cdaf9a166da19c484621 (diff)
downloadchromium_src-9f39293c0507c538c944de86ca6ce002c6feb2b2.zip
chromium_src-9f39293c0507c538c944de86ca6ce002c6feb2b2.tar.gz
chromium_src-9f39293c0507c538c944de86ca6ce002c6feb2b2.tar.bz2
Refresh the history page if history entries get deleted, except for when currently editing entries
BUG=82190 TEST=manual as described in the bug Review URL: http://codereview.chromium.org/7086030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/history.js')
-rw-r--r--chrome/browser/resources/history.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/chrome/browser/resources/history.js b/chrome/browser/resources/history.js
index c0a5287d..3fbb300 100644
--- a/chrome/browser/resources/history.js
+++ b/chrome/browser/resources/history.js
@@ -512,6 +512,14 @@ HistoryView.prototype.toggleEditMode = function() {
};
/**
+ * @return {boolean} Whether we are in edit mode where history items can be
+ * deleted
+ */
+HistoryView.prototype.getEditMode = function() {
+ return this.model_.getEditMode();
+};
+
+/**
* Reload the current view.
*/
HistoryView.prototype.reload = function() {
@@ -1022,7 +1030,6 @@ function deleteComplete() {
deleteNextInQueue();
} else {
deleteQueue = [];
- historyView.reload();
}
}
@@ -1037,6 +1044,17 @@ function deleteFailed() {
setTimeout(deleteNextInQueue, 500);
}
+/**
+ * We're called when something is deleted (either by us or by someone
+ * else).
+ */
+function historyDeleted() {
+ window.console.log('History deleted');
+ var anyChecked = document.querySelector('.entry input:checked') != null;
+ if (!(historyView.getEditMode() && anyChecked))
+ historyView.reload();
+}
+
// Add handlers to HTML elements.
document.body.onload = load;
$('history-section').onclick = function () {