mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-28 01:20:07 +00:00
Compare commits
2 Commits
92e2171bc8
...
1fe978703f
| Author | SHA1 | Date | |
|---|---|---|---|
| 1fe978703f | |||
| d04bf01748 |
@ -338,14 +338,17 @@ var templates = {
|
||||
// nested button...
|
||||
var nested_button
|
||||
header = header
|
||||
.trim()
|
||||
.replace(/\[([^\]]*)\]/g,
|
||||
function(_, text){
|
||||
nested_button = true
|
||||
return `<button>${ text.trim() }</button>` })
|
||||
return `<button class="template-action">${
|
||||
text.trim()
|
||||
}</button>` })
|
||||
// whole text is a button...
|
||||
if(!nested_button){
|
||||
header =
|
||||
`<button>${
|
||||
`<button class="template-action">${
|
||||
header.trim() == '' ?
|
||||
this.__default_button_text__
|
||||
: header.trim()
|
||||
@ -368,6 +371,8 @@ var templates = {
|
||||
while(e.tagName != 'BUTTON'
|
||||
&& e.parentElement != null){
|
||||
e = e.parentElement }
|
||||
if(!e.classList.contains('template-action')){
|
||||
return }
|
||||
if(e.tagName == 'BUTTON'){
|
||||
// get template data...
|
||||
var data = editor.data(elem)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user