There are several internal events sent from the nicEdit core that can be used in plugins and on your own javascript when doing advanced integration of the editor into your web sites.
blur |
Sent when an editor instance loses focus |
focus |
Send when an editor gains focus (IE someone clicks inside it)
|
key |
When the user presses a shortcut key (Such as control-b)
|
add |
Fired when a new instance is added |
panel |
Fired when the toolbar is initalized for new instances (This is the perfered event if you want to add a function when NicEdit instances are created) |
To attach functions to internal NicEdit events use the addEvent method on the nicInstance object
[some nicedit instance].addEvent([event name], [callback function]);
See this example below:
-
<script>
-
bkLib.onDomLoaded(function(){
-
var myInstance = new nicEditor().panelInstance('myArea2');
-
myInstance.addEvent('blur', function() {
-
// Your code here that is called whenever the user blurs (stops editing) the nicedit instance
-
});
-
});
-
</script>
Comments (0)
You don't have permission to comment on this page.