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:
parent
a56536ee5e
commit
0d0e552a09
|
@ -527,6 +527,10 @@ img {
|
||||||
padding: 0.2em 0.25em 0.2em 0.5em;
|
padding: 0.2em 0.25em 0.2em 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.note_tree_item {
|
||||||
|
padding: 0.2em 0.25em 0.2em 0;
|
||||||
|
}
|
||||||
|
|
||||||
.tree_expander {
|
.tree_expander {
|
||||||
float: left;
|
float: left;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
|
|
|
@ -2597,11 +2597,11 @@ Note_tree.prototype.add_link = function ( editor ) {
|
||||||
"href": "/notebooks/" + this.notebook_id + "?note_id=" + editor.id,
|
"href": "/notebooks/" + this.notebook_id + "?note_id=" + editor.id,
|
||||||
"id": "note_tree_link_" + editor.id,
|
"id": "note_tree_link_" + editor.id,
|
||||||
"class": "note_tree_link"
|
"class": "note_tree_link"
|
||||||
}, editor.title );
|
}, editor.title || "untitled note" );
|
||||||
|
|
||||||
appendChildNodes( "note_tree_area_holder", createDOM(
|
appendChildNodes( "note_tree_area_holder", createDOM(
|
||||||
"div",
|
"div",
|
||||||
{ "id": "note_tree_item_" + editor.id, "class": "link_area_item" },
|
{ "id": "note_tree_item_" + editor.id, "class": "note_tree_item" },
|
||||||
expander,
|
expander,
|
||||||
link
|
link
|
||||||
) );
|
) );
|
||||||
|
@ -2616,6 +2616,14 @@ Note_tree.prototype.remove_link = function ( id ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Note_tree.prototype.rename_link = function ( editor, new_title ) {
|
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 ) {
|
Note_tree.prototype.expand_link = function ( id ) {
|
||||||
|
|
|
@ -17,13 +17,13 @@ class Note_tree_area( Div ):
|
||||||
[ Div(
|
[ Div(
|
||||||
Div( class_ = u"tree_expander" ),
|
Div( class_ = u"tree_expander" ),
|
||||||
A(
|
A(
|
||||||
note.title,
|
note.title or u"untitled note",
|
||||||
href = u"/notebooks/%s?note_id=%s" % ( notebook.object_id, note.object_id ),
|
href = u"/notebooks/%s?note_id=%s" % ( notebook.object_id, note.object_id ),
|
||||||
id = u"note_tree_link_" + note.object_id,
|
id = u"note_tree_link_" + note.object_id,
|
||||||
class_ = u"note_tree_link",
|
class_ = u"note_tree_link",
|
||||||
),
|
),
|
||||||
id = u"note_tree_item_" + note.object_id,
|
id = u"note_tree_item_" + note.object_id,
|
||||||
class_ = u"link_area_item",
|
class_ = u"note_tree_item",
|
||||||
) for note in root_notes ],
|
) for note in root_notes ],
|
||||||
id = u"note_tree_area_holder",
|
id = u"note_tree_area_holder",
|
||||||
),
|
),
|
||||||
|
|
Reference in New Issue