mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-17 00:21:40 +00:00
minor fix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
1e790df062
commit
a65cf13db5
14
index.html
14
index.html
@ -49,17 +49,25 @@ var reload = () => {
|
|||||||
|
|
||||||
var update_editor = function(){
|
var update_editor = function(){
|
||||||
// XXX make this update on enter...
|
// XXX make this update on enter...
|
||||||
|
// XXX account for title of edited page...
|
||||||
$('.title')
|
$('.title')
|
||||||
.focus(function(){
|
.focus(function(){
|
||||||
$(this).text(Wiki.title)
|
var to = $(this).attr('saveto') || '.'
|
||||||
|
$(this).text(Wiki.get(to).title)
|
||||||
})
|
})
|
||||||
.blur(function(){
|
.blur(function(){
|
||||||
|
var to = $(this).attr('saveto') || '.'
|
||||||
var text = $(this).text().trim()
|
var text = $(this).text().trim()
|
||||||
|
var page = Wiki.get(to)
|
||||||
|
|
||||||
if(text[0] == '/'){
|
if(text[0] == '/'){
|
||||||
Wiki.path = text
|
page.path = text
|
||||||
} else {
|
} else {
|
||||||
Wiki.title = text
|
page.title = text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX need to account for changed path sufixes...
|
||||||
|
Wiki.path = page.path
|
||||||
reload()
|
reload()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
2
wiki.js
2
wiki.js
@ -726,7 +726,7 @@ var data = {
|
|||||||
+'</div>\n'
|
+'</div>\n'
|
||||||
+'\n'
|
+'\n'
|
||||||
+'<hr>\n'
|
+'<hr>\n'
|
||||||
+'<h1 class="title" contenteditable tabindex="0">'
|
+'<h1 class="title" contenteditable tabindex="0" saveto="..">'
|
||||||
+'<slot name="title">'
|
+'<slot name="title">'
|
||||||
+'@source(../title)'
|
+'@source(../title)'
|
||||||
+'</slot>'
|
+'</slot>'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user