Skip to content

Commit 1063dfe

Browse files
committed
fixed trigger
1 parent 4ff3f66 commit 1063dfe

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
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.2'
3+
__VERSION__ = '1.1.3'
44
__AUTHOR__ = 'Agus Makmun (Summon Agus)'
55
__AUTHOR_EMAIL__ = '[email protected]'

draceditor/static/js/draceditor.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Name : DracEditor v1.1.2
2+
* Name : DracEditor v1.1.3
33
* Created by : Agus Makmun (Summon Agus)
44
* Release date : 5-Jan-2017
55
* Official : https://dracos-linux.org
@@ -16,6 +16,8 @@
1616
var draceditor = $(this);
1717
var dracPreview = $('.draceditor-preview');
1818
var dracSplitter = $('.draceditor-splitter');
19+
var dracConfig = JSON.parse(draceditor.data('enable-configs').replace(/'/g, '"'));
20+
console.log(dracConfig);
1921

2022
draceditor.trigger('draceditor.init');
2123

@@ -132,8 +134,7 @@
132134
}
133135
}
134136
// Set autocomplete for ace editor
135-
var configs = JSON.parse(draceditor.data('enable-configs').replace(/'/g, '"'));
136-
if (configs.mention === 'true') {
137+
if (dracConfig.mention === 'true') {
137138
editor.completers = [emojiWordCompleter, mentionWordCompleter]
138139
}else {
139140
editor.completers = [emojiWordCompleter]
@@ -546,7 +547,7 @@
546547
},
547548
readOnly: true
548549
});
549-
if (draceditor.data('enable-configs').mention === 'true') {
550+
if (dracConfig.mention === 'true') {
550551
editor.commands.addCommand({
551552
name: 'markdownToMention',
552553
bindKey: {win: 'Ctrl-M', mac: 'Command-M'},
@@ -601,12 +602,11 @@
601602
// Custom decission for toolbar buttons.
602603
var btnMention = $('.markdown-direct-mention'); // To Direct Mention
603604
var btnUpload = $('.markdown-image-upload'); // To Upload Image
604-
var configs = JSON.parse(draceditor.data('enable-configs').replace(/'/g, '"'));
605-
if (configs.mention === 'true') {
605+
if (dracConfig.mention === 'true') {
606606
btnMention.click(function(){
607607
markdownToMention();
608608
});
609-
}else if (configs.imgur === 'true') {
609+
}if (dracConfig.imgur === 'true') {
610610
btnUpload.on('change', function(evt){
611611
evt.preventDefault();
612612
markdownToUploadImage();

0 commit comments

Comments
 (0)