Skip to content

Commit f722347

Browse files
committed
fixed button config
1 parent 1063dfe commit f722347

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

draceditor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
__VERSION__ = '1.1.3'
3+
__VERSION__ = '1.1.4'
44
__AUTHOR__ = 'Agus Makmun (Summon Agus)'
55
__AUTHOR_EMAIL__ = '[email protected]'

draceditor/static/js/draceditor.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Name : DracEditor v1.1.3
2+
* Name : DracEditor v1.1.4
33
* Created by : Agus Makmun (Summon Agus)
44
* Release date : 5-Jan-2017
55
* Official : https://dracos-linux.org
@@ -602,16 +602,27 @@
602602
// Custom decission for toolbar buttons.
603603
var btnMention = $('.markdown-direct-mention'); // To Direct Mention
604604
var btnUpload = $('.markdown-image-upload'); // To Upload Image
605-
if (dracConfig.mention === 'true') {
605+
if (dracConfig.mention === 'true' && dracConfig.imgur === 'true') {
606606
btnMention.click(function(){
607607
markdownToMention();
608608
});
609-
}if (dracConfig.imgur === 'true') {
610609
btnUpload.on('change', function(evt){
611610
evt.preventDefault();
612611
markdownToUploadImage();
613612
});
614-
}else {
613+
}else if (dracConfig.mention === 'true' && dracConfig.imgur === 'false') {
614+
btnMention.click(function(){
615+
markdownToMention();
616+
});
617+
btnUpload.remove();
618+
}else if (dracConfig.mention === 'false' && dracConfig.imgur === 'true') {
619+
btnMention.remove();
620+
btnUpload.on('change', function(evt){
621+
evt.preventDefault();
622+
markdownToUploadImage();
623+
});
624+
}
625+
else {
615626
btnMention.remove();
616627
btnUpload.remove();
617628
// Disable help of `mention`

0 commit comments

Comments
 (0)