From a46f418fb60b3974fe459ba89566a82cbc0e724b Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 25 May 2016 13:28:27 -0600 Subject: [PATCH] Fix unwanted highlight matching when favorite had additional filters --- api/js/jsapi/app_base.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/js/jsapi/app_base.js b/api/js/jsapi/app_base.js index 22c9ff5ae7..783fe12666 100644 --- a/api/js/jsapi/app_base.js +++ b/api/js/jsapi/app_base.js @@ -926,8 +926,10 @@ var AppJS = (function(){ "use strict"; return Class.extend( if(!favorite || jQuery.isEmptyObject(favorite)) return; var match_count = 0; + var extra_keys = Object.keys(favorite.state); for(var state_key in state) { + extra_keys.splice(extra_keys.indexOf(state_key),1); if(typeof favorite.state != 'undefined' && typeof state[state_key] != 'undefined'&&typeof favorite.state[state_key] != 'undefined' && ( state[state_key] == favorite.state[state_key] || !state[state_key] && !favorite.state[state_key])) { match_count++; @@ -990,6 +992,11 @@ var AppJS = (function(){ "use strict"; return Class.extend( return; } } + // Check for anything set that the current one does not have + for(var i = 0; i < extra_keys.length; i++) + { + if(favorite.state[extra_keys[i]]) return; + } if(match_count > best_count) { best_match = this.dataset.id;