Browse Source

Check draggability for the canvas and components

pull/758/head
Artur Arseniev 8 years ago
parent
commit
3aeafacbe3
  1. 4
      src/canvas/index.js
  2. 1
      src/commands/index.js
  3. 4
      src/dom_components/model/Component.js

4
src/canvas/index.js

@ -1,4 +1,4 @@
import { on, off } from 'utils/mixins';
import { on, off, hasDnd } from 'utils/mixins';
import Droppable from 'utils/Droppable';
module.exports = () => {
@ -395,7 +395,7 @@ module.exports = () => {
},
postRender() {
this.droppable = new Droppable(c.em);
if (hasDnd(c.em)) this.droppable = new Droppable(c.em);
},
/**

1
src/commands/index.js

@ -190,7 +190,6 @@ module.exports = () => {
}
});
} else {
console.log(em.get('Config'));
if (event.type == 'dragstart') {
event.dataTransfer.setDragImage(sel.view.el, 0, 0);
//sel.set('status', 'freezed');

4
src/dom_components/model/Component.js

@ -7,7 +7,7 @@ import {
isString,
keys
} from 'underscore';
import { shallowDiff } from 'utils/mixins';
import { shallowDiff, hasDnd } from 'utils/mixins';
import Styleable from 'domain_abstract/model/Styleable';
const Backbone = require('backbone');
@ -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: { dragstart: 'execCommand' },
events: hasDnd(this.em) ? { dragstart: 'execCommand' } : '',
command: 'tlb-move'
});
}

Loading…
Cancel
Save