Mercurial > hg > LGToc
comparison js/check_sections_details.js @ 1:1f9d2bfe1d13
handle new section created by user, update sections_index table
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 19 Mar 2015 18:36:21 +0100 |
parents | 723a162b6627 |
children | 5d0bfd909857 |
comparison
equal
deleted
inserted
replaced
0:723a162b6627 | 1:1f9d2bfe1d13 |
---|---|
103 } | 103 } |
104 function addEntry(obj,pos){//obj: the obj next to which we would like to add a new entry, pos: before the obj or after the obj | 104 function addEntry(obj,pos){//obj: the obj next to which we would like to add a new entry, pos: before the obj or after the obj |
105 var clone=$(".clone").clone(true); | 105 var clone=$(".clone").clone(true); |
106 clone.removeClass("clone"); | 106 clone.removeClass("clone"); |
107 clone.show(); | 107 clone.show(); |
108 | |
109 clone.children(".hiddenInfo").children(".id").html(0); // set section id to 0 | |
110 | |
111 // bug: section_after field is not correct | |
112 | |
113 | |
108 if(pos==0){ | 114 if(pos==0){ |
109 clone.insertBefore(obj); | 115 clone.insertBefore(obj); |
110 //$("<br>").insertAfter(clone); | 116 //$("<br>").insertAfter(clone); |
111 }else{ | 117 }else{ |
112 clone.insertAfter(obj); | 118 clone.insertAfter(obj); |
113 //$("<br>").insertBefore(clone); | 119 //$("<br>").insertBefore(clone); |
114 } | 120 } |
121 | |
122 | |
115 $("#searchResults .sequence").each(function(idx){ | 123 $("#searchResults .sequence").each(function(idx){ |
116 $(this).html(idx+1); | 124 $(this).html(idx+1); |
117 }); | 125 }); |
118 } | 126 } |
119 function initPage(){// init the column start page & end page, so that they turn into input boxes when clicked | 127 function initPage(){// init the column start page & end page, so that they turn into input boxes when clicked |