diff --git a/public/assets/kindeditor/at/config.js b/public/assets/kindeditor/at/config.js index f26685f00..45e7c3195 100644 --- a/public/assets/kindeditor/at/config.js +++ b/public/assets/kindeditor/at/config.js @@ -10,10 +10,11 @@ var enableAt = function(_editor) { var ifr = editor.edit.iframe[0]; var doc = ifr.contentDocument || iframe.contentWindow.document; var ifrBody = doc.body; - ifrBody.contentEditable = true; + //ifrBody.contentEditable = false; + $(ifrBody).attr('enable_at', 'true'); console.log("enable at"); - $.fn.atwho.debug = true; + //$.fn.atwho.debug = true; var names = []; @@ -41,6 +42,6 @@ var enableAt = function(_editor) { }; $inputor = $(ifrBody).atwho(at_config); - $inputor.caret('pos', 47); - $inputor.focus().atwho('run'); + //$inputor.caret('pos', 47); + //$inputor.focus().atwho('run'); }; diff --git a/public/assets/kindeditor/at/jquery.atwho.js b/public/assets/kindeditor/at/jquery.atwho.js index 1e6c8ec25..cd2caf6ca 100644 --- a/public/assets/kindeditor/at/jquery.atwho.js +++ b/public/assets/kindeditor/at/jquery.atwho.js @@ -97,7 +97,7 @@ App = (function() { App.prototype.reg = function(flag, setting) { var base, controller; - controller = (base = this.controllers)[flag] || (base[flag] = this.$inputor.is('[contentEditable]') ? new EditableController(this, flag) : new TextareaController(this, flag)); + controller = (base = this.controllers)[flag] || (base[flag] = this.$inputor.is('[enable_at]') ? new EditableController(this, flag) : new TextareaController(this, flag)); if (setting.alias) { this.aliasMaps[setting.alias] = flag; } @@ -1110,7 +1110,7 @@ $.fn.atwho = function(method) { var _args, result; _args = arguments; result = null; - this.filter('textarea, input, [contenteditable=""], [contenteditable=true]').each(function() { + this.filter('textarea, input, [contenteditable=""], [contenteditable=true], [enable_at=true]').each(function() { var $this, app; if (!(app = ($this = $(this)).data("atwho"))) { $this.data('atwho', (app = new App(this)));