jQuery 2.2.1 and Bludit menu v8 bug fixes

This commit is contained in:
dignajar 2016-02-24 02:22:24 -03:00
parent 8a640af1ce
commit f72f224f0e
3 changed files with 23 additions and 7 deletions

View File

@ -27,7 +27,7 @@ class HTML {
// Prevent the form submit when press enter key.
$("form").keypress(function(e) {
if (e.which == 13) {
if( (e.which == 13) && (e.target.type !== "textarea") ) {
return false;
}
});

File diff suppressed because one or more lines are too long

View File

@ -47,6 +47,17 @@ var menuV8 = new function() {
}
// This function is the default to add the image to the textarea.
// Only call when the textarea doesn't have a HTML Editor enabled.
function editorAddImageDefault(filename) {
var textarea = $("#jscontent");
var imgHTML = '<img src="'+filename+'" alt="">';
textarea.val(textarea.val() + imgHTML);
}
$(document).ready(function() {
// Click on document.
@ -87,8 +98,13 @@ $(document).ready(function() {
// Insert image
$("body").on("click", "#bludit-menuV8-insert", function(e) {
// This function is defined in each editor plugin.
editorAddImage( menuV8.getFilename() );
if(typeof editorAddImage == 'function') {
// This function is defined in each editor plugin.
editorAddImage( menuV8.getFilename() );
}
else {
editorAddImageDefault( menuV8.getFilename() );
}
});