> //              if (!story.isDirty(this.tiddler))
> //                      
> store.setTiddlerTag(tiddler.title,!tiddler.tags.contains
> (tag),tag); // this one works in VIEW mode
> //              else
>                         story.setTiddlerTag(tiddler.title,tag,0); // this one 
> workd in EDIT
> mode
>                 return false;
>         }

> like it's said in comments, I found that it's not the same function to
> toggle tag depending on the edit mode of the tiddler. But "isDirty"
> don't really tell's me if it's currently in EDIT mode or not...

story.isDirty('SomeTitle') looks at the currently rendered *story*
column to determine if the tiddler is in edit mode, even if no changes
have been made to the content, so it *is* the function you want to
use.

In contrast, store.isDirty() looks at the tiddler internal-data
*store* to indicate if anything in the document has been modified.
Unfortunately, however, there is currently no *built-in* (TW core)
tracking for testing a specific tiddler to see if it has been changed.

Fortunately, I've written a plugin to address this:
   http://www.TiddlyTools.com/#UnsavedChangesPlugin
adds tracking for individual tiddler changes and provides several
forms of output to display and manage the current list of tiddlers
with unsaved changes.

In addition, after the plugin is installed, you can use the following
javascript expression to test a tiddler to see if it has been changed,
regardless of whether is is being edited at the moment.

config.macros.unsavedChanges.changed.contains('TiddlerTitle')

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to