[gitg] Do not cache has-selection in diff view js
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Do not cache has-selection in diff view js
- Date: Tue, 1 Jul 2014 09:24:54 +0000 (UTC)
commit f3fa97864a39b49a49a069268f26b568da1f45bf
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Tue Jul 1 11:24:33 2014 +0200
Do not cache has-selection in diff view js
libgitg/resources/diff-view.js | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/libgitg/resources/diff-view.js b/libgitg/resources/diff-view.js
index 27aabca..104d8ea 100644
--- a/libgitg/resources/diff-view.js
+++ b/libgitg/resources/diff-view.js
@@ -166,20 +166,13 @@ function has_class(e, cls)
return e.classList.contains(cls);
}
-var has_selection = false;
-
function update_has_selection()
{
var selection = document.querySelectorAll('tr.added.selected, tr.removed.selected');
var hs = (selection.length != 0);
- if (hs != has_selection)
- {
- has_selection = hs;
-
- var v = has_selection ? "yes" : "no";
- xhr_get('internal', {action: 'selection-changed', value: v});
- }
+ var v = hs ? "yes" : "no";
+ xhr_get('internal', {action: 'selection-changed', value: v});
}
function prepare_patchset(filediv)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]