It was just to illustrate an idea, that <button>name</button> only generates a look alike button.
- The div was just to hide the proper button, if not used this method would look like this;
If you look closer, this is one button widget that displays according to the state of the popup, which is the existence of a temp field. Notice how the button does nothing else at all?
- I believe this may be the easiest way to toggle a condition.
I was not planning to create a “canonical solution” but something to talk about and share comments on the code used. However perhaps this is not the best way to demonstrate the uses of a simple html button <button>name</button> because of the ambiguity and a standard way will suffice.
it now reads without the tag-div and
<%if [<notes.popup.tiddler>has[title]] %>
View Notes
<%else%>
Edit Notes
<%endif%>
The other tag div was to introduce other class/styles but I will remove that too.
Final result? possibly not, its designed to be talked about
\procedure view/edit-notes()
\function notes.popup.tiddler() [<qualify $:/temp/edit-notes>]
\define note.database() $:/note.database
<$button popup=<<notes.popup.tiddler>> tooltip="view/edit.notes for this tiddler">
<%if [<notes.popup.tiddler>has[title]] %>View Notes<%else%>Edit Notes<%endif%>
</$button>
<%if [<notes.popup.tiddler>has[title]] %>
<$edit tiddler=<<note.database>> index=<<currentTiddler>> class="tc-edit-texteditor tc-popup-handle" />
<% elseif [<note.database>getindex<currentTiddler>!is[blank]] %>
<fieldset style="padding: .5em; "><$transclude tiddler=<<note.database>> index=<<currentTiddler>> mode="block" /></fieldset>
<%endif%>
\end view/edit-notes
<<view/edit-notes>>
Thanks for highlighting this was obscure.