-Unencode favorite search, firefox leaves encoded spaces

-If adding a favorite with same name as existing favorite, old one is removed from the sidebox.
This commit is contained in:
Nathan Gray 2014-02-06 17:53:29 +00:00
parent 0198a5196f
commit 444d82d1c7

View File

@ -235,6 +235,9 @@ var AppJS = Class.extend(
for(var i = 0; i < et2.length; i++) for(var i = 0; i < et2.length; i++)
{ {
et2[i].widgetContainer.iterateOver(function(_widget) { et2[i].widgetContainer.iterateOver(function(_widget) {
// Firefox has trouble with spaces in search
if(state.state.search) state.state.search = unescape(state.state.search);
// Apply // Apply
_widget.activeFilters = state.state || state.filter || {}; _widget.activeFilters = state.state || state.filter || {};
_widget.applyFilters(); _widget.applyFilters();
@ -487,6 +490,10 @@ var AppJS = Class.extend(
}; };
if(self.sidebox) if(self.sidebox)
{ {
// Remove any existing with that name
$j('[data-id="'+safe_name+'"]',self.sidebox).remove();
// Create new item
var html = "<li data-id='"+safe_name+"' class='ui-menu-item' role='menuitem'>\n"; var html = "<li data-id='"+safe_name+"' class='ui-menu-item' role='menuitem'>\n";
html += "<a href='#' class='ui-corner-all' tabindex='-1'>"; html += "<a href='#' class='ui-corner-all' tabindex='-1'>";
html += "<div class='" + 'sideboxstar' + "'></div>"+ html += "<div class='" + 'sideboxstar' + "'></div>"+