pull/362/merge
Arthur Corenzan 8 years ago committed by GitHub
commit 990984f98b

@ -630,18 +630,17 @@ function drawLink(editor) {
/**
* Action for drawing an img.
*/
function drawImage(editor) {
function drawImage(editor, url) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
var url = "http://";
if(options.promptURLs) {
url = prompt(options.promptTexts.image);
if(!url) {
return false;
}
}
_replaceSelection(cm, stat.image, options.insertTexts.image, url);
_replaceSelection(cm, stat.image, options.insertTexts.image, url || "http://");
}
/**
@ -1947,8 +1946,8 @@ SimpleMDE.prototype.cleanBlock = function() {
SimpleMDE.prototype.drawLink = function() {
drawLink(this);
};
SimpleMDE.prototype.drawImage = function() {
drawImage(this);
SimpleMDE.prototype.drawImage = function(url) {
drawImage(this, url);
};
SimpleMDE.prototype.drawTable = function() {
drawTable(this);
@ -2025,4 +2024,4 @@ SimpleMDE.prototype.toTextArea = function() {
}
};
module.exports = SimpleMDE;
module.exports = SimpleMDE;

Loading…
Cancel
Save