[New Edit Mode] Fixed positioning of dropped objects #386
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
"type": "telemetry.panel",
|
||||
"templateUrl": "templates/fixed.html",
|
||||
"uses": [ "composition" ],
|
||||
"gestures": [ "drop" ],
|
||||
"toolbar": {
|
||||
"sections": [
|
||||
{
|
||||
|
||||
@@ -273,12 +273,15 @@ define(
|
||||
}
|
||||
|
||||
// Position a panel after a drop event
|
||||
function handleDrop(e, id, position) {
|
||||
function handleDrop(e, id, position, editableDomainObject) {
|
||||
// Don't handle this event if it has already been handled
|
||||
// color is set to "" to let the CSS theme determine the default color
|
||||
if (e.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
if (editableDomainObject){
|
||||
$scope.setEditable(editableDomainObject);
|
||||
}
|
||||
e.preventDefault();
|
||||
// Store the position of this element.
|
||||
addElement({
|
||||
|
||||
@@ -62,10 +62,15 @@ define(
|
||||
}
|
||||
|
||||
// Position a panel after a drop event
|
||||
function handleDrop(e, id, position) {
|
||||
//An editableDomainObject is provided, as the drop may have
|
||||
// triggered a transition to edit mode.
|
||||
function handleDrop(e, id, position, editableDomainObject) {
|
||||
if (e.defaultPrevented) {
|
||||
return;
|
||||
}
|
||||
if (editableDomainObject){
|
||||
$scope.setEditable(editableDomainObject);
|
||||
}
|
||||
// Ensure that configuration field is populated
|
||||
$scope.configuration = $scope.configuration || {};
|
||||
// Make sure there is a "panels" field in the
|
||||
|
||||
Reference in New Issue
Block a user