mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 14:18:16 +00:00
[Layout] Separate out handleDrop
Separate drop-handling into a non-anonymous function in LayoutController to satisfy code style guidelines; WTD-877.
This commit is contained in:
@ -82,11 +82,8 @@ define(
|
|||||||
ids.forEach(populatePosition);
|
ids.forEach(populatePosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Position panes when the model field changes
|
// Position a panel after a drop event
|
||||||
$scope.$watch("model.composition", lookupPanels);
|
function handleDrop(e, id, position) {
|
||||||
|
|
||||||
// Position panes where they are dropped
|
|
||||||
$scope.$on("mctDrop", function (e, id, position) {
|
|
||||||
// Make sure there is a "panels" field in the
|
// Make sure there is a "panels" field in the
|
||||||
// view configuration.
|
// view configuration.
|
||||||
$scope.configuration.panels =
|
$scope.configuration.panels =
|
||||||
@ -103,7 +100,13 @@ define(
|
|||||||
if ($scope.commit) {
|
if ($scope.commit) {
|
||||||
$scope.commit("Dropped a frame.");
|
$scope.commit("Dropped a frame.");
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
// Position panes when the model field changes
|
||||||
|
$scope.$watch("model.composition", lookupPanels);
|
||||||
|
|
||||||
|
// Position panes where they are dropped
|
||||||
|
$scope.$on("mctDrop", handleDrop);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user