Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/js/fields/advanced/EditorField.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@
self.editor.setReadOnly(true);
}

self.initAceEvents();

// if the editor's dom element gets destroyed, make sure we clean up the editor instance
// normally, we expect Alpaca fields to be destroyed by the destroy() method but they may also be
// cleaned-up via the DOM, thus we check here.
Expand All @@ -217,6 +219,26 @@

},

initAceEvents: function()
{
var self = this;

if (self.editor) {

// blur event
self.editor.on('blur', function (e) {
self.onBlur();
self.trigger("blur", e);
});

// focus event
self.editor.on("focus", function (e) {
self.onFocus.call(self, e);
self.trigger("focus", e);
});
}
},

/**
* @see Alpaca.Field#destroy
*/
Expand Down