Skip to content

Instantly share code, notes, and snippets.

@oguzhankircali
Last active February 9, 2018 10:46
Show Gist options
  • Save oguzhankircali/f0cbcf6627ec19df29856008bb6aec19 to your computer and use it in GitHub Desktop.
Save oguzhankircali/f0cbcf6627ec19df29856008bb6aec19 to your computer and use it in GitHub Desktop.
Summernote Constructor
$('#ModelText').summernote({
height: 250,
lang: 'tr-TR',
fontSizes: ['10', '12', '14'],
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['fontsize', ['fontsize']],
['para', ['ul', 'ol', 'paragraph']],
['note-view', ['codeview']]
],
callbacks: {
onChange: function (contents, $editable) {
//when text changed
},
onPaste: function (e) {
//to past without style
var bufferText = ((e.originalEvent || e).clipboardData || window.clipboardData).getData('Text');
e.preventDefault();
document.execCommand('insertText', false, bufferText);
}
}
});
$('.note-editable').css('font-size', '12px'); //set default font size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment