From: Mike Taylor Date: Fri, 1 May 2015 13:51:47 +0000 (+0100) Subject: Part of MKWS-64. X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=69a1c5b925c62f7441a256034454863dd14d4a75;p=mkws-moved-to-github.git 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. --- 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());