Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
tree now scrolls elements into view.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Apr 26, 2014
1 parent 295e8a0 commit f742997
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion elements/x-tree/x-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

update: function() {
var selected = this.selected;
var tabsize = 32;
var tabsize = 12;
var components = this.components = [];

function subtree(root, indent) {
Expand Down Expand Up @@ -101,6 +101,14 @@
}

subtree(this.canvas, 4);

// scroll selected into view.
this.onMutation(this.$.tree, function() {
var e = this.$.tree.querySelector('.selected');
if (e) {
e.scrollIntoViewIfNeeded();
}
});
},

selectAction: function(event, detail, sender) {
Expand Down

0 comments on commit f742997

Please sign in to comment.