Add deepCopy() method (not yet working) and the private methods that it uses.
authorMike Taylor <mike@indexdata.com>
Tue, 12 May 2015 10:01:49 +0000 (11:01 +0100)
committerMike Taylor <mike@indexdata.com>
Tue, 12 May 2015 10:01:49 +0000 (11:01 +0100)
src/mkws-filter.js

index 004fe83..6df47aa 100644 (file)
@@ -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) + "<br/>");
+    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;
 }