From 69a1c5b925c62f7441a256034454863dd14d4a75 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 1 May 2015 14:51:47 +0100 Subject: [PATCH] Part of MKWS-64. Expand the urlFragment() method to accept an optional set of overrides which take precedence over the values of the present state. This can be used to generate fragments for actions which change state. --- src/mkws-team.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mkws-team.js b/src/mkws-team.js index aac101a..cfbe165 100644 --- a/src/mkws-team.js +++ b/src/mkws-team.js @@ -73,11 +73,12 @@ mkws.makeTeam = function($, teamName) { delete m_default.filters; $.extend(m_default, tmp.fragmentItems()); - that.urlFragment = function() { + that.urlFragment = function(overrides) { var s; + that.warn("making urlFragment with overrides " + mkws.$.toJSON(overrides)); // Expand the filterSet into a set of key=value properties - var state = $.extend(true, {}, m_state); + var state = $.extend(true, {}, m_state, overrides ? overrides : {}); var tmp = state.filters; delete state.filters; $.extend(state, tmp.fragmentItems()); -- 1.7.10.4