Browse Source

Enable native D&D by default but skip it for components

pull/758/head
Artur Arseniev 9 years ago
parent
commit
ece0083047
  1. 2
      src/block_manager/view/BlockView.js
  2. 2
      src/dom_components/model/Component.js
  3. 2
      src/editor/config/config.js

2
src/block_manager/view/BlockView.js

@ -32,6 +32,8 @@ module.exports = Backbone.View.extend({
handleDragStart(ev) {
const content = this.model.get('content');
// Firefox requires setData
ev.dataTransfer.setData('text', null);
// Can't put the content in dataTransfer as it will not be available
// on `dragenter` event for security reason
this.config.em.set('dragContent', content);

2
src/dom_components/model/Component.js

@ -498,7 +498,7 @@ const Component = Backbone.Model.extend(Styleable).extend(
if (model.get('draggable')) {
tb.push({
attributes: { class: 'fa fa-arrows', draggable: true },
events: hasDnd(this.em) ? { dragstart: 'execCommand' } : '',
//events: hasDnd(this.em) ? { dragstart: 'execCommand' } : '',
command: 'tlb-move'
});
}

2
src/editor/config/config.js

@ -60,7 +60,7 @@ module.exports = {
jsInHtml: true,
// Enable native HTML5 drag and drop
nativeDnD: 0,
nativeDnD: 1,
// Show the wrapper component in the final code, eg. in editor.getHtml()
exportWrapper: 0,

Loading…
Cancel
Save