jQuery 2.2.1 and Bludit menu v8 bug fixes
This commit is contained in:
parent
8a640af1ce
commit
f72f224f0e
|
@ -27,7 +27,7 @@ class HTML {
|
||||||
|
|
||||||
// Prevent the form submit when press enter key.
|
// Prevent the form submit when press enter key.
|
||||||
$("form").keypress(function(e) {
|
$("form").keypress(function(e) {
|
||||||
if (e.which == 13) {
|
if( (e.which == 13) && (e.target.type !== "textarea") ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
// Click on document.
|
// Click on document.
|
||||||
|
@ -87,8 +98,13 @@ $(document).ready(function() {
|
||||||
// Insert image
|
// Insert image
|
||||||
$("body").on("click", "#bludit-menuV8-insert", function(e) {
|
$("body").on("click", "#bludit-menuV8-insert", function(e) {
|
||||||
|
|
||||||
// This function is defined in each editor plugin.
|
if(typeof editorAddImage == 'function') {
|
||||||
editorAddImage( menuV8.getFilename() );
|
// This function is defined in each editor plugin.
|
||||||
|
editorAddImage( menuV8.getFilename() );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
editorAddImageDefault( menuV8.getFilename() );
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue