-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from iMi-digital/feature-ckeditor
Feature ckeditor
- Loading branch information
Showing
4 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters