UNPKG

jquery-textcomplete

Version:

[![npm version](https://badge.fury.io/js/jquery-textcomplete.svg)](http://badge.fury.io/js/jquery-textcomplete) [![Bower version](https://badge.fury.io/bo/jquery-textcomplete.svg)](http://badge.fury.io/bo/jquery-textcomplete) [![Analytics](https://ga-beac

33 lines (28 loc) 1.08 kB
// NOTE: TextComplete plugin has contenteditable support but it does not work // fine especially on old IEs. // Any pull requests are REALLY welcome. +function ($) { 'use strict'; // CKEditor adapter // ======================= // // Adapter for CKEditor, based on contenteditable elements. function CKEditor (element, completer, option) { this.initialize(element, completer, option); } $.extend(CKEditor.prototype, $.fn.textcomplete.ContentEditable.prototype, { _bindEvents: function () { var $this = this; CKEDITOR.instances["issue_notes"].on('key', function(event) { var domEvent = event.data; $this._onKeyup(domEvent); if ($this.completer.dropdown.shown && $this._skipSearch(domEvent)) { return false; } }, null, null, 1); // 1 = Priority = Important! // we actually also need the native event, as the CKEditor one is happening to late this.$el.on('keyup.' + this.id, $.proxy(this._onKeyup, this)); }, }); $.fn.textcomplete.CKEditor = CKEditor; }(jQuery);