Example demonstrates how to remove 'Not Set' option from
font size and
family dropdowns.
Example code
<script type="text/JavaScript">
function EditorOnLoad(editor){
if(editor._mySaved_fontSizeState == null || typeof editor._mySaved_fontSizeState == "undefined" ||
editor._mySaved_fontNameState == null || typeof editor._mySaved_fontNameState == "undefined"){
// replace Editor's fontSizeState function
if(editor._mySaved_fontSizeState == null || typeof editor._mySaved_fontSizeState == "undefined"){
editor._mySaved_fontSizeState = editor.fontSizeState;
editor._fontSizeState_option_deleted = false;
editor.fontSizeState = function(id){
if(typeof id != "undefined" && !this._fontSizeState_option_deleted){ // first run
var select = document.getElementById(id).childNodes.item(1);
select.remove(0); // remove the first option with 'Not Set'
this._fontSizeState_option_deleted = true;
}
return editor._mySaved_fontSizeState(id); // call saved function
}
}
// replace Editor's fontNameState function
if(editor._mySaved_fontNameState == null || typeof editor._mySaved_fontNameState == "undefined"){
editor._mySaved_fontNameState = editor.fontNameState;
editor._fontNameState_option_deleted = false;
editor.fontNameState = function(id){
if(typeof id != "undefined" && !this._fontNameState_option_deleted){ // first run
var select = document.getElementById(id).childNodes.item(1);
select.remove(0); // remove the first option with 'Not Set'
this._fontNameState_option_deleted = true;
}
return this._mySaved_fontNameState(id); // call saved function
}
}
editor.updateToolbar(); // force these replaced functions call
}
}
</script>
Just put this script block into your page with
Editor.
You will see no
'Not Set' options in dropdowns of this example: