From 23640d7af44fda362c7bdd2b01b2d92f4641a603 Mon Sep 17 00:00:00 2001 From: Devin Weaver Date: Fri, 25 Apr 2014 08:44:34 -0400 Subject: [PATCH] Add isDraft to Tiddler object Check to see if this tiddler is a draft (has a draft.of field) --- boot/boot.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boot/boot.js b/boot/boot.js index b02e2380f..74d736cce 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -791,6 +791,10 @@ $tw.Tiddler.prototype.hasField = function(field) { return $tw.utils.hop(this.fields,field); }; +$tw.Tiddler.prototype.isDraft = function() { + return this.hasField("draft.of"); +}; + /* Register and install the built in tiddler field modules */