From: Mike Taylor Date: Tue, 12 May 2015 10:01:49 +0000 (+0100) Subject: Add deepCopy() method (not yet working) and the private methods that it uses. X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=6abaab34cb022bcb0a7736ca77a4508e57e3e821;p=mkws-moved-to-github.git Add deepCopy() method (not yet working) and the private methods that it uses. --- diff --git a/src/mkws-filter.js b/src/mkws-filter.js index 004fe83..6df47aa 100644 --- a/src/mkws-filter.js +++ b/src/mkws-filter.js @@ -124,6 +124,23 @@ function filterSet(team) { return hash; }; + that.deepCopy = function() { + var fs = filterSet(m_team); + document.write("setting list to " + mkws.$.toJSON(m_list) + "
"); + fs._setList($.extend({}, m_list)); + return fs; + }; + + // Used only by clone() + that._setList = function(list) { + m_list = list; + }; + + /// Shouldn't be used at all + that._list = function() { + return m_list; + }; + return that; }