Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix track addition so that new tracks always added on top

  • Loading branch information...
commit f2d9b543aa8931d3ef0b85c134e7fc7bbdd563ec 1 parent d5098f5
Lincoln Stein authored
Showing with 4 additions and 17 deletions.
  1. +4 −17 htdocs/js/controller.js
View
21 htdocs/js/controller.js
@@ -245,30 +245,17 @@ var GBrowseController = Class.create({
//element back out. This keeps the other tracks intact.
if (onTop == null) onTop = false;
- var tmp_element = document.createElement("tmp_element");
- tmp_element.innerHTML = child_html;
+// var tmp_element = document.createElement("tmp_element");
+// tmp_element.innerHTML = child_html;
var tracks = parent_obj.getElementsByClassName('track');
var first_track = tracks[0];
if (onTop && first_track != null)
- parent_obj.insert(tmp_element,{before: first_track[0]});
+ first_track.insert({before: child_html});
else
- parent_obj.insert(tmp_element);
+ parent_obj.insert(child_html);
- // Move each child node but skip if it is a comment (class is undef)
- if (tmp_element.hasChildNodes()) {
- var children = tmp_element.childNodes;
- for (var i = 0; i < children.length; i++) {
- if (children[i].className == undefined)
- continue;
- if (onTop && first_track != null)
- parent_obj.insert(children[i],{before:first_track});
- else
- parent_obj.insert(children[i]);
- }
- }
- parent_obj.removeChild(tmp_element);
},
// Update Section Methods *****************************************
Please sign in to comment.
Something went wrong with that request. Please try again.