Skip to content

Commit

Permalink
fixed button config
Browse files Browse the repository at this point in the history
  • Loading branch information
agusmakmun committed Jan 5, 2017
1 parent 1063dfe commit f722347
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion draceditor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

__VERSION__ = '1.1.3'
__VERSION__ = '1.1.4'
__AUTHOR__ = 'Agus Makmun (Summon Agus)'
__AUTHOR_EMAIL__ = 'agus@python.web.id'
19 changes: 15 additions & 4 deletions draceditor/static/js/draceditor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Name : DracEditor v1.1.3
* Name : DracEditor v1.1.4
* Created by : Agus Makmun (Summon Agus)
* Release date : 5-Jan-2017
* Official : https://dracos-linux.org
Expand Down Expand Up @@ -602,16 +602,27 @@
// Custom decission for toolbar buttons.
var btnMention = $('.markdown-direct-mention'); // To Direct Mention
var btnUpload = $('.markdown-image-upload'); // To Upload Image
if (dracConfig.mention === 'true') {
if (dracConfig.mention === 'true' && dracConfig.imgur === 'true') {
btnMention.click(function(){
markdownToMention();
});
}if (dracConfig.imgur === 'true') {
btnUpload.on('change', function(evt){
evt.preventDefault();
markdownToUploadImage();
});
}else {
}else if (dracConfig.mention === 'true' && dracConfig.imgur === 'false') {
btnMention.click(function(){
markdownToMention();
});
btnUpload.remove();
}else if (dracConfig.mention === 'false' && dracConfig.imgur === 'true') {
btnMention.remove();
btnUpload.on('change', function(evt){
evt.preventDefault();
markdownToUploadImage();
});
}
else {
btnMention.remove();
btnUpload.remove();
// Disable help of `mention`
Expand Down

0 comments on commit f722347

Please sign in to comment.