HTML: prevent implicit type conversion on testing

== comparison of true, false, null, allows implicit type conversion,
thus using === instead

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2014-06-06 19:48:39 +03:00 committed by Dirk Hohndel
parent 8432e23c09
commit 60e512c6f4

View file

@ -345,11 +345,11 @@ function sort_it(sortOn,function_){
} }
for(var i=0;i< itemsToShow.length ;i++){ for(var i=0;i< itemsToShow.length ;i++){
for(var j=0;j<itemsToShow.length;j++) for(var j=0;j<itemsToShow.length;j++)
if(visited[j] == false) if(visited[j] === false)
var iSmaller=j; var iSmaller=j;
for(var j=0;j<itemsToShow.length;j++){ for(var j=0;j<itemsToShow.length;j++){
if(function_(itemsToShow[j],itemsToShow[iSmaller])){ if(function_(itemsToShow[j],itemsToShow[iSmaller])){
if(visited[j] == false){ if(visited[j] === false){
iSmaller = j; iSmaller = j;
} }
} }
@ -390,7 +390,7 @@ Set.prototype.forEach = function(do_){
}; };
Set.prototype.Union = function(another_set){ Set.prototype.Union = function(another_set){
if (another_set == null) { if (another_set === null) {
return; return;
} }
for(var i=0; i<another_set.keys.length ;i++){ for(var i=0; i<another_set.keys.length ;i++){
@ -427,19 +427,19 @@ function SearchModules(searchfor){
resultKeys.Union(x.search(searchfor)); resultKeys.Union(x.search(searchfor));
}); });
if(searchingModules["location"].enabled==true) if(searchingModules["location"].enabled===true)
resultKeys.Union(searchingModules["location"].search(searchfor)); resultKeys.Union(searchingModules["location"].search(searchfor));
if(searchingModules["divemaster"].enabled==true) if(searchingModules["divemaster"].enabled===true)
resultKeys.Union(searchingModules["divemaster"].search(searchfor)); resultKeys.Union(searchingModules["divemaster"].search(searchfor));
if(searchingModules["buddy"].enabled==true) if(searchingModules["buddy"].enabled===true)
resultKeys.Union(searchingModules["buddy"].search(searchfor)); resultKeys.Union(searchingModules["buddy"].search(searchfor));
if(searchingModules["notes"].enabled==true) if(searchingModules["notes"].enabled===true)
resultKeys.Union(searchingModules["notes"].search(searchfor)); resultKeys.Union(searchingModules["notes"].search(searchfor));
if(searchingModules["tags"].enabled==true) if(searchingModules["tags"].enabled===true)
resultKeys.Union(searchingModules["tags"].search(searchfor)); resultKeys.Union(searchingModules["tags"].search(searchfor));
if(resultKeys.isEmpty()){ if(resultKeys.isEmpty()){
@ -545,7 +545,7 @@ function showtrips(){
} }
function toggle_trip_expansion(trip){ function toggle_trip_expansion(trip){
if(trips[trip].expanded ==true){ if(trips[trip].expanded ===true){
unexpand_trip(trip); unexpand_trip(trip);
}else{ }else{
expand_trip(trip); expand_trip(trip);