Commit 9e6a6545 authored by Romain Loth's avatar Romain Loth

fix find

parent de49b2af
......@@ -41,6 +41,7 @@ var $search_histogram = $("#search_histogram")
//method for calling the ISC-API and get pubs-distribution of the suggested term
function search_proposed_terms_and_draw( the_queries ) {
// console.log("search_proposed_terms_and_draw:\n"
// +"i'm searching:\n"
// +JSON.stringify(the_queries)) ;
......@@ -94,8 +95,8 @@ function search_proposed_terms_and_draw( the_queries ) {
},
error: function(exception) {
console.log("search_proposed_terms_and_draw:exception"
+ JSON.stringify(exception))
// console.log("search_proposed_terms_and_draw:exception"
// + JSON.stringify(exception))
$search_histogram
.html('<p class="micromessage">'
+'<b>No histogram</b>: too many nodes selected</b>'
......@@ -106,7 +107,7 @@ function search_proposed_terms_and_draw( the_queries ) {
// gotNodeSet event when Tinawab did main search behavior (select nodes)
$("#searchinput").on("tw:gotNodeSet", function(e) {
// console.log("event 'nodes' --> the event's nodes: " + JSON.stringify(e.nodeIds)) ;
// console.warn("event 'nodes' --> the event's nodes: " + JSON.stringify(e.nodeIds)) ;
clean_histogram() ;
// now we may want to do other things (draw histogram, suggest term)
......@@ -116,13 +117,14 @@ $("#searchinput").on("tw:gotNodeSet", function(e) {
// eraseNodeSet event when Tinawab canceled the previous selections
$("#searchinput").on("tw:eraseNodeSet", function(e) {
// console.log("event 'erase'") ;
// console.warn("event 'erase'") ;
clean_histogram() ;
$search_histogram.hide() ;
});
// emptyNodeSet event when Tinaweb search found nothing
$("#searchinput").on("tw:emptyNodeSet", function(e) {
// console.warn("event 'not found'") ;
clean_histogram() ;
$search_histogram.hide() ;
});
......
......@@ -270,9 +270,10 @@ function find(lquery){
if (typeof lquery == 'string' && lquery.length > 0) {
lquery=lquery.toLowerCase() ;
var nds = getnodes()
// console.log("FIND: looking among nodes", nds)
for(var i in nds){
var n=nds[i];
if(n.hidden==false){
if(! n.hidden){
var possiblematch=n.label.toLowerCase()
// string.indexOf(substring) faster than search/match
if (possiblematch.indexOf(lquery)!==-1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment