witten
/
luminotes
Archived
1
0
Fork 0

Reducing indenting of top-level note tree items.

Made "untitled note" the title for note tree links with no titles.
This commit is contained in:
Dan Helfman 2008-04-10 00:05:03 +00:00
parent a56536ee5e
commit 0d0e552a09
3 changed files with 16 additions and 4 deletions

View File

@ -527,6 +527,10 @@ img {
padding: 0.2em 0.25em 0.2em 0.5em;
}
.note_tree_item {
padding: 0.2em 0.25em 0.2em 0;
}
.tree_expander {
float: left;
width: 20px;

View File

@ -2597,11 +2597,11 @@ Note_tree.prototype.add_link = function ( editor ) {
"href": "/notebooks/" + this.notebook_id + "?note_id=" + editor.id,
"id": "note_tree_link_" + editor.id,
"class": "note_tree_link"
}, editor.title );
}, editor.title || "untitled note" );
appendChildNodes( "note_tree_area_holder", createDOM(
"div",
{ "id": "note_tree_item_" + editor.id, "class": "link_area_item" },
{ "id": "note_tree_item_" + editor.id, "class": "note_tree_item" },
expander,
link
) );
@ -2616,6 +2616,14 @@ Note_tree.prototype.remove_link = function ( id ) {
}
Note_tree.prototype.rename_link = function ( editor, new_title ) {
var link = getElement( "note_tree_link_" + editor.id );
if ( !link ) {
this.add_link( editor );
return;
}
replaceChildNodes( link, new_title || "untitled note" );
}
Note_tree.prototype.expand_link = function ( id ) {

View File

@ -17,13 +17,13 @@ class Note_tree_area( Div ):
[ Div(
Div( class_ = u"tree_expander" ),
A(
note.title,
note.title or u"untitled note",
href = u"/notebooks/%s?note_id=%s" % ( notebook.object_id, note.object_id ),
id = u"note_tree_link_" + note.object_id,
class_ = u"note_tree_link",
),
id = u"note_tree_item_" + note.object_id,
class_ = u"link_area_item",
class_ = u"note_tree_item",
) for note in root_notes ],
id = u"note_tree_area_holder",
),