mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Check that we have items in markdown cell paste handler
This commit is contained in:
parent
e66ff8f001
commit
646619d5cd
@ -406,14 +406,16 @@ define([
|
||||
$(div).on('paste', function(evt) {
|
||||
var data = evt.originalEvent.clipboardData;
|
||||
var items = data.items;
|
||||
for (var i = 0; i < items.length; ++i) {
|
||||
var item = items[i];
|
||||
if (item.kind == 'file' && attachment_regex.test(item.type)) {
|
||||
// TODO(julienr): This does not stop code_mirror from pasting
|
||||
// the filename.
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
that.insert_inline_image_from_blob(item.getAsFile());
|
||||
if (data.items !== undefined) {
|
||||
for (var i = 0; i < items.length; ++i) {
|
||||
var item = items[i];
|
||||
if (item.kind == 'file' && attachment_regex.test(item.type)) {
|
||||
// TODO(julienr): This does not stop code_mirror from pasting
|
||||
// the filename.
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
that.insert_inline_image_from_blob(item.getAsFile());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user