Skip to content

Commit

Permalink
Fix bug #163 (button disappear)
Browse files Browse the repository at this point in the history
  • Loading branch information
agusmakmun committed Jul 15, 2021
1 parent 41e907c commit ae80bfd
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 52 deletions.
2 changes: 1 addition & 1 deletion martor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

__VERSION__ = '1.6.3'
__VERSION__ = '1.6.4'
__AUTHOR__ = 'Agus Makmun (Summon Agus)'
__AUTHOR_EMAIL__ = 'summon.agus@gmail.com'
4 changes: 2 additions & 2 deletions martor/static/martor/css/martor-admin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions martor/static/martor/css/martor.bootstrap.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions martor/static/martor/css/martor.semantic.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 13 additions & 20 deletions martor/static/martor/js/martor.bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Name : Martor v1.6.3
* Name : Martor v1.6.4
* Created by : Agus Makmun (Summon Agus)
* Release date : 13-Jun-2021
* Release date : 15-Jul-2021
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
* Repository : https://github.com/agusmakmun/django-markdown-editor
**/
Expand Down Expand Up @@ -748,33 +748,26 @@
});

// Custom decission for toolbar buttons.
var btnMention = $('.markdown-direct-mention[data-field-name='+field_name+']'); // To Direct Mention
var btnUpload = $('.markdown-image-upload[data-field-name='+field_name+']'); // To Upload Image
if (editorConfig.mention === 'true' && editorConfig.imgur === 'true') {
btnMention.click(function(){
markdownToMention(editor);
});
btnUpload.on('change', function(evt){
evt.preventDefault();
markdownToUploadImage(editor);
});
}else if (editorConfig.mention === 'true' && editorConfig.imgur === 'false') {
var btnMention = $('.markdown-direct-mention[data-field-name='+field_name+']'); // To Direct Mention
var btnUpload = $('.markdown-image-upload[data-field-name='+field_name+']'); // To Upload Image

if (editorConfig.mention == 'true') {
btnMention.click(function(){
markdownToMention(editor);
});
btnUpload.remove();
}else if (editorConfig.mention === 'false' && editorConfig.imgur === 'true') {
}else {
btnMention.remove();
// Disable help of `mention`
$('.markdown-reference tbody tr')[1].remove();
}

if (editorConfig.imgur == 'true') {
btnUpload.on('change', function(evt){
evt.preventDefault();
markdownToUploadImage(editor);
});
}
else {
btnMention.remove();
}else {
btnUpload.remove();
// Disable help of `mention`
$('.markdown-reference tbody tr')[1].remove();
}

// Modal Popup for Help Guide & Emoji Cheat Sheet
Expand Down
6 changes: 3 additions & 3 deletions martor/static/martor/js/martor.bootstrap.min.js

Large diffs are not rendered by default.

31 changes: 12 additions & 19 deletions martor/static/martor/js/martor.semantic.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Name : Martor v1.6.3
* Name : Martor v1.6.4
* Created by : Agus Makmun (Summon Agus)
* Release date : 13-Jun-2021
* Release date : 15-Jul-2021
* License : GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
* Repository : https://github.com/agusmakmun/django-markdown-editor
**/
Expand Down Expand Up @@ -744,32 +744,25 @@

// Custom decission for toolbar buttons.
var btnMention = $('.markdown-direct-mention[data-field-name='+field_name+']'); // To Direct Mention
var btnUpload = $('.markdown-image-upload[data-field-name='+field_name+']'); // To Upload Image
if (editorConfig.mention === 'true' && editorConfig.imgur === 'true') {
btnMention.click(function(){
markdownToMention(editor);
});
btnUpload.on('change', function(evt){
evt.preventDefault();
markdownToUploadImage(editor);
});
}else if (editorConfig.mention === 'true' && editorConfig.imgur === 'false') {
var btnUpload = $('.markdown-image-upload[data-field-name='+field_name+']'); // To Upload Image

if (editorConfig.mention === 'true') {
btnMention.click(function(){
markdownToMention(editor);
});
btnUpload.remove();
}else if (editorConfig.mention === 'false' && editorConfig.imgur === 'true') {
}else {
btnMention.remove();
// Disable help of `mention`
$('.markdown-reference tbody tr')[1].remove();
}

if (editorConfig.imgur === 'true') {
btnUpload.on('change', function(evt){
evt.preventDefault();
markdownToUploadImage(editor);
});
}
else {
btnMention.remove();
} else {
btnUpload.remove();
// Disable help of `mention`
$('.markdown-reference tbody tr')[1].remove();
}

// Modal Popup for Help Guide & Emoji Cheat Sheet
Expand Down
Loading

0 comments on commit ae80bfd

Please sign in to comment.