From 3da70b925f0af24b8ac9eefa522d508108b95850 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 6 Jun 2012 22:19:34 +0100 Subject: [PATCH] Saving a shadow tiddler preserves its shadow status --- core/modules/wiki.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 08acae6e1..ea0131b65 100644 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -108,10 +108,11 @@ exports.addTiddler = function(tiddler,isShadow) { if(!(tiddler instanceof $tw.Tiddler)) { tiddler = new $tw.Tiddler(tiddler); } - if(isShadow) { + var title = tiddler.fields.title, + prevTiddler = this.tiddlers[title]; + if(isShadow || (prevTiddler && prevTiddler.isShadow)) { tiddler.isShadow = true; } - var title = tiddler.fields.title; this.tiddlers[title] = tiddler; this.clearCache(title); this.touchTiddler(title);