From 8730c7688466fcee80a0766679fe6c7869711f93 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 26 Oct 2012 17:57:57 +0100 Subject: [PATCH] Saving maps in CecilyView --- core/modules/macros/list/listviews/cecily.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/modules/macros/list/listviews/cecily.js b/core/modules/macros/list/listviews/cecily.js index e82da89ca..7585844d0 100644 --- a/core/modules/macros/list/listviews/cecily.js +++ b/core/modules/macros/list/listviews/cecily.js @@ -36,7 +36,7 @@ CecilyListView.prototype.getMapTiddlerTitle = function() { }; CecilyListView.prototype.loadMap = function() { - this.map = this.listMacro.wiki.getTiddlerData(this.getMapTiddlerTitle(),{positions: []}); + this.map = this.listMacro.wiki.getTiddlerData(this.getMapTiddlerTitle(),{positions: {}}); }; CecilyListView.prototype.saveMap = function() { @@ -62,13 +62,17 @@ CecilyListView.prototype.lookupTiddlerInMap = function(title,domNode) { this.newTiddlerPosition.x += newPosition.w * 1.2; break; } - // Return the position - return newPosition || { + // A default position + newPosition = newPosition || { x: 0, y: 0, w: 100, h: 100 }; + // Save the position back to the map + this.map.positions[title] = newPosition; + this.saveMap(); + return newPosition; }; CecilyListView.prototype.positionTiddler = function(title,domNode) {