Skip to content

Commit ae80bfd

Browse files
committed
Fix bug #163 (button disappear)
1 parent 41e907c commit ae80bfd

File tree

8 files changed

+38
-52
lines changed

8 files changed

+38
-52
lines changed

martor/__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.6.3'
3+
__VERSION__ = '1.6.4'
44
__AUTHOR__ = 'Agus Makmun (Summon Agus)'
55
__AUTHOR_EMAIL__ = '[email protected]'

martor/static/martor/css/martor-admin.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/css/martor.bootstrap.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/css/martor.semantic.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/js/martor.bootstrap.js

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Name : Martor v1.6.3
2+
* Name : Martor v1.6.4
33
* Created by : Agus Makmun (Summon Agus)
4-
* Release date : 13-Jun-2021
4+
* Release date : 15-Jul-2021
55
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
66
* Repository : https://github.com/agusmakmun/django-markdown-editor
77
**/
@@ -748,33 +748,26 @@
748748
});
749749

750750
// Custom decission for toolbar buttons.
751-
var btnMention = $('.markdown-direct-mention[data-field-name='+field_name+']'); // To Direct Mention
752-
var btnUpload = $('.markdown-image-upload[data-field-name='+field_name+']'); // To Upload Image
753-
if (editorConfig.mention === 'true' && editorConfig.imgur === 'true') {
754-
btnMention.click(function(){
755-
markdownToMention(editor);
756-
});
757-
btnUpload.on('change', function(evt){
758-
evt.preventDefault();
759-
markdownToUploadImage(editor);
760-
});
761-
}else if (editorConfig.mention === 'true' && editorConfig.imgur === 'false') {
751+
var btnMention = $('.markdown-direct-mention[data-field-name='+field_name+']'); // To Direct Mention
752+
var btnUpload = $('.markdown-image-upload[data-field-name='+field_name+']'); // To Upload Image
753+
754+
if (editorConfig.mention == 'true') {
762755
btnMention.click(function(){
763756
markdownToMention(editor);
764757
});
765-
btnUpload.remove();
766-
}else if (editorConfig.mention === 'false' && editorConfig.imgur === 'true') {
758+
}else {
767759
btnMention.remove();
760+
// Disable help of `mention`
761+
$('.markdown-reference tbody tr')[1].remove();
762+
}
763+
764+
if (editorConfig.imgur == 'true') {
768765
btnUpload.on('change', function(evt){
769766
evt.preventDefault();
770767
markdownToUploadImage(editor);
771768
});
772-
}
773-
else {
774-
btnMention.remove();
769+
}else {
775770
btnUpload.remove();
776-
// Disable help of `mention`
777-
$('.markdown-reference tbody tr')[1].remove();
778771
}
779772

780773
// Modal Popup for Help Guide & Emoji Cheat Sheet

martor/static/martor/js/martor.bootstrap.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

martor/static/martor/js/martor.semantic.js

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* Name : Martor v1.6.3
2+
* Name : Martor v1.6.4
33
* Created by : Agus Makmun (Summon Agus)
4-
* Release date : 13-Jun-2021
4+
* Release date : 15-Jul-2021
55
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
66
* Repository : https://github.com/agusmakmun/django-markdown-editor
77
**/
@@ -744,32 +744,25 @@
744744

745745
// Custom decission for toolbar buttons.
746746
var btnMention = $('.markdown-direct-mention[data-field-name='+field_name+']'); // To Direct Mention
747-
var btnUpload = $('.markdown-image-upload[data-field-name='+field_name+']'); // To Upload Image
748-
if (editorConfig.mention === 'true' && editorConfig.imgur === 'true') {
749-
btnMention.click(function(){
750-
markdownToMention(editor);
751-
});
752-
btnUpload.on('change', function(evt){
753-
evt.preventDefault();
754-
markdownToUploadImage(editor);
755-
});
756-
}else if (editorConfig.mention === 'true' && editorConfig.imgur === 'false') {
747+
var btnUpload = $('.markdown-image-upload[data-field-name='+field_name+']'); // To Upload Image
748+
749+
if (editorConfig.mention === 'true') {
757750
btnMention.click(function(){
758751
markdownToMention(editor);
759752
});
760-
btnUpload.remove();
761-
}else if (editorConfig.mention === 'false' && editorConfig.imgur === 'true') {
753+
}else {
762754
btnMention.remove();
755+
// Disable help of `mention`
756+
$('.markdown-reference tbody tr')[1].remove();
757+
}
758+
759+
if (editorConfig.imgur === 'true') {
763760
btnUpload.on('change', function(evt){
764761
evt.preventDefault();
765762
markdownToUploadImage(editor);
766763
});
767-
}
768-
else {
769-
btnMention.remove();
764+
} else {
770765
btnUpload.remove();
771-
// Disable help of `mention`
772-
$('.markdown-reference tbody tr')[1].remove();
773766
}
774767

775768
// Modal Popup for Help Guide & Emoji Cheat Sheet

0 commit comments

Comments
 (0)