﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
11301	Blur event doesn't fire the first time that it should	Jeremie Wood		"See demonstration page here: [http://terrafirma.org/ckeditor_test.html http://terrafirma.org/ckeditor_test.html] 

When automatic inline editing is turned off and an inline editor instance is created manually, the editor's blur event does not fire the first time you click outside the editor.

What I expect to happen:

1. Click the edit button to edit the text
2. Click outside the editor area when done editing
3. The editor's blur event should fire

However, the first time you click outside the editor area, nothing happens. You have to click on the editable text and then click outside a second time before the blur event fires.

Here's the code that I'm using:

{{{
(function($) {
  $(function() {
    CKEDITOR.disableAutoInline = true;

    $('#edit_button').click(function(e) {
      var editable = $('#editable_text');
      var editor = CKEDITOR.instances[editable.attr('id')];
      if (typeof(editor) === ""undefined"") {
        editable.attr('contenteditable', true);
        CKEDITOR.inline(editable.prop('id')).on('blur', function() {
          saveData(editable, true);
        });
      }
      editable.focus();
    });
  });

  function saveData(element, async) {
    var dom_obj = $(element);
    var editor = CKEDITOR.instances[dom_obj.attr(""id"")];
    if (typeof(editor) !== ""undefined"") {
      editor.destroy();
    }
    dom_obj.attr('contenteditable', false);
    alert('CKEditor blur event fired');
  }

}(jQuery));
}}}"	Bug	closed	Normal		General		invalid		
