Drag and drop fixes (#2249)

* Drag-drop edit mode from capture handler. Drag-drop composition from bubble handler. Check composability on drag start

* Show drop hints without being in edit mode.

* Don't serialize objects twice on drag
This commit is contained in:
Andrew Henry
2019-01-11 11:20:57 -08:00
committed by Pete Richards
parent cb1a1c2616
commit 4084a1ac86
10 changed files with 36 additions and 30 deletions

View File

@ -44,7 +44,12 @@ export default {
},
methods: {
dragStart(event) {
event.dataTransfer.setData("domainObject", JSON.stringify(this.observedObject));
let navigatedObject = this.openmct.router.path[0];
let serializedObject = JSON.stringify(this.observedObject);
if (this.openmct.composition.checkPolicy(navigatedObject, this.observedObject)) {
event.dataTransfer.setData("openmct/composable-domain-object", serializedObject);
}
event.dataTransfer.setData("openmct/domain-object", serializedObject);
}
}
}