Last active
February 9, 2018 10:46
-
-
Save oguzhankircali/f0cbcf6627ec19df29856008bb6aec19 to your computer and use it in GitHub Desktop.
Summernote Constructor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#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