From 5521c1987c42ab1122b2b17cc95ad9c80c1cfe7b Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 30 Apr 2015 17:54:06 +0100 Subject: [PATCH] team.urlFragment() uses filterSet.fragmentItems() to render out the selected filters as a set of key=value pairs. --- src/mkws-team.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/mkws-team.js b/src/mkws-team.js index bae55cf..cbac794 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -67,14 +67,24 @@ mkws.makeTeam = function($, teamName) { m_state.sort = config.sort_default; m_state.size = config.perpage_default; + var m_default = $.extend(true, {}, m_state); + var tmp = m_default.filters; + delete m_default.filters; + $.extend(m_default, tmp.fragmentItems()); that.urlFragment = function () { var s; - for (var key in m_state) { - if (m_state.hasOwnProperty(key) && - m_state[key] != m_default[key]) { + // Expand the filterSet into a set of key=value properties + var state = $.extend(true, {}, m_state); + var tmp = state.filters; + delete state.filters; + $.extend(state, tmp.fragmentItems()); + + for (var key in state) { + if (state.hasOwnProperty(key) && + state[key] != m_default[key]) { if (!s) { var s = 'mkws'; if (m_teamName !== 'AUTO') s += m_teamName; @@ -83,7 +93,8 @@ mkws.makeTeam = function($, teamName) { s += "@"; } - s += key + '=' + m_state[key]; + // ### how do we need to quote this? + s += key + '=' + state[key]; } } -- 1.7.10.4