clearwing

changeset 186:0af3aa605e94 1.2.3-genius

Fix to tap-hint.js for autocomplete bug with alias
author Stelios <stv@roe.ac.uk>
date Thu Dec 22 16:09:50 2016 +0000 (2016-12-22)
parents 0c0c9f40ee21
children e17af038eed4
files src/static/js/adql_syntax/tap-hint.js
line diff
     1.1 --- a/src/static/js/adql_syntax/tap-hint.js	Tue Dec 20 02:53:21 2016 +0000
     1.2 +++ b/src/static/js/adql_syntax/tap-hint.js	Thu Dec 22 16:09:50 2016 +0000
     1.3 @@ -673,17 +673,20 @@
     1.4      }
     1.5  
     1.6      var query = doc.getRange(validRange.start, validRange.end, false);
     1.7 -
     1.8 +    var prev;
     1.9      for (var i = 0; i < query.length; i++) {
    1.10        var lineText = query[i];
    1.11        eachWord(lineText, function(word) {
    1.12          var wordUpperCase = word.toUpperCase();
    1.13 -
    1.14 -	        if (wordUpperCase === aliasUpperCase){
    1.15 +    
    1.16 +	        if (wordUpperCase === aliasUpperCase && prev.toUpperCase()==CONS.ALIAS_KEYWORD.toUpperCase()){
    1.17  	          table = previousWord;
    1.18  	        }
    1.19 -	        if (wordUpperCase !== CONS.ALIAS_KEYWORD)
    1.20 +	        
    1.21 +	        prev = word;
    1.22 +	        if (wordUpperCase !== CONS.ALIAS_KEYWORD){
    1.23  	          previousWord = word;
    1.24 +	        } 
    1.25  	      });
    1.26  	      if (table) break;
    1.27  	    }