mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-28 17:40:07 +00:00
cleanup and minor fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d6e975c86a
commit
d04bf01748
@ -338,14 +338,17 @@ var templates = {
|
|||||||
// nested button...
|
// nested button...
|
||||||
var nested_button
|
var nested_button
|
||||||
header = header
|
header = header
|
||||||
|
.trim()
|
||||||
.replace(/\[([^\]]*)\]/g,
|
.replace(/\[([^\]]*)\]/g,
|
||||||
function(_, text){
|
function(_, text){
|
||||||
nested_button = true
|
nested_button = true
|
||||||
return `<button>${ text.trim() }</button>` })
|
return `<button class="template-action">${
|
||||||
|
text.trim()
|
||||||
|
}</button>` })
|
||||||
// whole text is a button...
|
// whole text is a button...
|
||||||
if(!nested_button){
|
if(!nested_button){
|
||||||
header =
|
header =
|
||||||
`<button>${
|
`<button class="template-action">${
|
||||||
header.trim() == '' ?
|
header.trim() == '' ?
|
||||||
this.__default_button_text__
|
this.__default_button_text__
|
||||||
: header.trim()
|
: header.trim()
|
||||||
@ -368,6 +371,8 @@ var templates = {
|
|||||||
while(e.tagName != 'BUTTON'
|
while(e.tagName != 'BUTTON'
|
||||||
&& e.parentElement != null){
|
&& e.parentElement != null){
|
||||||
e = e.parentElement }
|
e = e.parentElement }
|
||||||
|
if(!e.classList.contains('template-action')){
|
||||||
|
return }
|
||||||
if(e.tagName == 'BUTTON'){
|
if(e.tagName == 'BUTTON'){
|
||||||
// get template data...
|
// get template data...
|
||||||
var data = editor.data(elem)
|
var data = editor.data(elem)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user