Skip to content

Commit

Permalink
fixed trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
agusmakmun committed Jan 5, 2017
1 parent 4ff3f66 commit 1063dfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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.2'
__VERSION__ = '1.1.3'
__AUTHOR__ = 'Agus Makmun (Summon Agus)'
__AUTHOR_EMAIL__ = '[email protected]'
14 changes: 7 additions & 7 deletions draceditor/static/js/draceditor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Name : DracEditor v1.1.2
* Name : DracEditor v1.1.3
* Created by : Agus Makmun (Summon Agus)
* Release date : 5-Jan-2017
* Official : https://dracos-linux.org
Expand All @@ -16,6 +16,8 @@
var draceditor = $(this);
var dracPreview = $('.draceditor-preview');
var dracSplitter = $('.draceditor-splitter');
var dracConfig = JSON.parse(draceditor.data('enable-configs').replace(/'/g, '"'));
console.log(dracConfig);

draceditor.trigger('draceditor.init');

Expand Down Expand Up @@ -132,8 +134,7 @@
}
}
// Set autocomplete for ace editor
var configs = JSON.parse(draceditor.data('enable-configs').replace(/'/g, '"'));
if (configs.mention === 'true') {
if (dracConfig.mention === 'true') {
editor.completers = [emojiWordCompleter, mentionWordCompleter]
}else {
editor.completers = [emojiWordCompleter]
Expand Down Expand Up @@ -546,7 +547,7 @@
},
readOnly: true
});
if (draceditor.data('enable-configs').mention === 'true') {
if (dracConfig.mention === 'true') {
editor.commands.addCommand({
name: 'markdownToMention',
bindKey: {win: 'Ctrl-M', mac: 'Command-M'},
Expand Down Expand Up @@ -601,12 +602,11 @@
// Custom decission for toolbar buttons.
var btnMention = $('.markdown-direct-mention'); // To Direct Mention
var btnUpload = $('.markdown-image-upload'); // To Upload Image
var configs = JSON.parse(draceditor.data('enable-configs').replace(/'/g, '"'));
if (configs.mention === 'true') {
if (dracConfig.mention === 'true') {
btnMention.click(function(){
markdownToMention();
});
}else if (configs.imgur === 'true') {
}if (dracConfig.imgur === 'true') {
btnUpload.on('change', function(evt){
evt.preventDefault();
markdownToUploadImage();
Expand Down

0 comments on commit 1063dfe

Please sign in to comment.