mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-16 22:44:29 -06:00
IE11 compat. Fix status bar.
This commit is contained in:
parent
d317873fb0
commit
bbf3340581
@ -4,8 +4,11 @@ All notable changes to easymde will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
<!--## [Unreleased]-->
|
## [Unreleased/Forked]
|
||||||
Merge 2.7.0 with https://github.com/Ionaru/easy-markdown-editor/pull/71 @jeroenvo
|
- Merge 2.7.0 with https://github.com/Ionaru/easy-markdown-editor/pull/71 @jeroenvo
|
||||||
|
- replace MouseEvent(click) with .click() for IE compat
|
||||||
|
- Fix status bar update when dragging but not dropping
|
||||||
|
-
|
||||||
|
|
||||||
## [2.7.0] - 2019-07-13
|
## [2.7.0] - 2019-07-13
|
||||||
### Added
|
### Added
|
||||||
|
@ -727,6 +727,7 @@ function afterImageUploaded(editor, url) {
|
|||||||
var options = editor.options;
|
var options = editor.options;
|
||||||
var imageName = url.substr(url.lastIndexOf('/') + 1);
|
var imageName = url.substr(url.lastIndexOf('/') + 1);
|
||||||
_replaceSelection(cm, stat.image, options.insertTexts.uploadedImage, url);
|
_replaceSelection(cm, stat.image, options.insertTexts.uploadedImage, url);
|
||||||
|
// show uploaded image filename for 1000ms
|
||||||
editor.updateStatusBar('upload-image', editor.options.imageTexts.sbOnUploaded.replace('#image_name#', imageName));
|
editor.updateStatusBar('upload-image', editor.options.imageTexts.sbOnUploaded.replace('#image_name#', imageName));
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
editor.updateStatusBar('upload-image', editor.options.imageTexts.sbInit);
|
editor.updateStatusBar('upload-image', editor.options.imageTexts.sbInit);
|
||||||
@ -1619,8 +1620,19 @@ function EasyMDE(options) {
|
|||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
this.codemirror.on('dragend', function(cm, event) {
|
||||||
|
self.updateStatusBar('upload-image', self.options.imageTexts.sbInit);
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
});
|
||||||
|
this.codemirror.on('dragleave', function(cm, event) {
|
||||||
|
self.updateStatusBar('upload-image', self.options.imageTexts.sbInit);
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
this.codemirror.on('dragover', function(cm, event) {
|
this.codemirror.on('dragover', function(cm, event) {
|
||||||
|
self.updateStatusBar('upload-image', self.options.imageTexts.sbOnDragEnter);
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
@ -1944,7 +1956,7 @@ EasyMDE.prototype.clearAutosavedValue = function () {
|
|||||||
EasyMDE.prototype.openBrowseFileWindow = function(onSuccess, onError) {
|
EasyMDE.prototype.openBrowseFileWindow = function(onSuccess, onError) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var imageInput = this.gui.toolbar.getElementsByClassName('imageInput')[0];
|
var imageInput = this.gui.toolbar.getElementsByClassName('imageInput')[0];
|
||||||
imageInput.dispatchEvent(new MouseEvent('click'));
|
imageInput.click() //dispatchEvent(new MouseEvent('click')); // replaced with click() for IE11 compatibility.
|
||||||
function onChange(event) {
|
function onChange(event) {
|
||||||
self.uploadImages(event.target.files, onSuccess, onError);
|
self.uploadImages(event.target.files, onSuccess, onError);
|
||||||
imageInput.removeEventListener('change', onChange);
|
imageInput.removeEventListener('change', onChange);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user