Skip to content

Commit

Permalink
restore expander/collapser after language change
Browse files Browse the repository at this point in the history
  • Loading branch information
smurp committed Sep 18, 2018
1 parent ec11259 commit f833a03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/huviz.js
Original file line number Diff line number Diff line change
Expand Up @@ -11063,7 +11063,7 @@ Possible Bug: it appears that <div class="container" id="classes"> has a redunda
if (node_elem == null) {
node_elem = this.id_to_elem[node_id];
}
label_elem = node_elem.querySelector('p.treepicker-label');
label_elem = node_elem.querySelector('p.treepicker-label span.label');
if (label_elem != null) {
return label_elem.textContent = this.id_to_name[node_id];
}
Expand Down Expand Up @@ -11114,7 +11114,7 @@ Possible Bug: it appears that <div class="container" id="classes"> has a redunda
msg = "show_tree() just did @id_to_elem[" + node_id + "] = contents_of_me";
picker = this;
contents_of_me.on('click', this.click_handler);
contents_of_me.append("p").attr("class", "treepicker-label").text(label);
contents_of_me.append("p").attr("class", "treepicker-label").append('span').attr('class', 'label').text(label);
if (rest.length > 1) {
my_contents = this.get_or_create_container(contents_of_me);
if (top && this.extra_classes) {
Expand Down
7 changes: 4 additions & 3 deletions src/treepicker.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class TreePicker
# This takes the current value of @id_to_name[node_id] and displays it in the HTML.
# Why? Because the label might be a MultiString whose language might have changed.
node_elem ?= @id_to_elem[node_id] # look up node_elem if it is not passed in
label_elem = node_elem.querySelector('p.treepicker-label')
label_elem = node_elem.querySelector('p.treepicker-label span.label')
if label_elem?
label_elem.textContent = @id_to_name[node_id]
get_comparison_value: (node_id, label) ->
Expand Down Expand Up @@ -152,8 +152,9 @@ class TreePicker
msg = "show_tree() just did @id_to_elem[#{node_id}] = contents_of_me"
#console.info(msg)
picker = this
contents_of_me.on 'click', @click_handler
contents_of_me.append("p").attr("class", "treepicker-label").text(label)
contents_of_me.on('click', @click_handler)
contents_of_me.append("p").attr("class", "treepicker-label").
append('span').attr('class','label').text(label)
if rest.length > 1
my_contents = @get_or_create_container(contents_of_me)
if top and @extra_classes
Expand Down

0 comments on commit f833a03

Please sign in to comment.