|
|
@ -3,7 +3,7 @@ |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
import { on } from 'utils/mixins'; |
|
|
import { on } from 'utils/mixins'; |
|
|
import { bindAll } from 'underscore'; |
|
|
import { bindAll, indexOf } from 'underscore'; |
|
|
|
|
|
|
|
|
export default class Droppable { |
|
|
export default class Droppable { |
|
|
constructor(em) { |
|
|
constructor(em) { |
|
|
@ -138,17 +138,17 @@ export default class Droppable { |
|
|
} |
|
|
} |
|
|
} else if (dragContent) { |
|
|
} else if (dragContent) { |
|
|
content = dragContent; |
|
|
content = dragContent; |
|
|
} else if (types.indexOf('text/html') >= 0) { |
|
|
} else if (indexOf(types, 'text/html') >= 0) { |
|
|
content = dataTransfer |
|
|
content = dataTransfer |
|
|
.getData('text/html') |
|
|
.getData('text/html') |
|
|
.replace(/<\/?meta[^>]*>/g, ''); |
|
|
.replace(/<\/?meta[^>]*>/g, ''); |
|
|
} else if (types.indexOf('text/uri-list') >= 0) { |
|
|
} else if (indexOf(types, 'text/uri-list') >= 0) { |
|
|
content = { |
|
|
content = { |
|
|
type: 'link', |
|
|
type: 'link', |
|
|
attributes: { href: content }, |
|
|
attributes: { href: content }, |
|
|
content: content |
|
|
content: content |
|
|
}; |
|
|
}; |
|
|
} else if (types.indexOf('text/json') >= 0) { |
|
|
} else if (indexOf(types, 'text/json') >= 0) { |
|
|
const json = dataTransfer.getData('text/json'); |
|
|
const json = dataTransfer.getData('text/json'); |
|
|
json && (content = JSON.parse(json)); |
|
|
json && (content = JSON.parse(json)); |
|
|
} |
|
|
} |
|
|
|