mirror of
https://github.com/nasa/openmct.git
synced 2025-06-23 01:18:57 +00:00
Merge pull request #930 from nasa/open633
[New Edit Mode] #633 Remove Editing workflow concerns from FixedController, LayoutController
This commit is contained in:
@ -91,14 +91,8 @@ define(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setEditable(editableDomainObject) {
|
|
||||||
self.domainObject = editableDomainObject;
|
|
||||||
scope.model = editableDomainObject.getModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Place the "commit" method in the scope
|
// Place the "commit" method in the scope
|
||||||
scope.commit = commit;
|
scope.commit = commit;
|
||||||
scope.setEditable = setEditable;
|
|
||||||
|
|
||||||
// Clean up when the scope is destroyed
|
// Clean up when the scope is destroyed
|
||||||
scope.$on("$destroy", function () {
|
scope.$on("$destroy", function () {
|
||||||
|
@ -71,9 +71,6 @@ define([
|
|||||||
"uses": [
|
"uses": [
|
||||||
"composition"
|
"composition"
|
||||||
],
|
],
|
||||||
"gestures": [
|
|
||||||
"drop"
|
|
||||||
],
|
|
||||||
"toolbar": {
|
"toolbar": {
|
||||||
"sections": [
|
"sections": [
|
||||||
{
|
{
|
||||||
|
@ -271,15 +271,13 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Position a panel after a drop event
|
// Position a panel after a drop event
|
||||||
function handleDrop(e, id, position, editableDomainObject) {
|
function handleDrop(e, id, position) {
|
||||||
// Don't handle this event if it has already been handled
|
// Don't handle this event if it has already been handled
|
||||||
// color is set to "" to let the CSS theme determine the default color
|
// color is set to "" to let the CSS theme determine the default color
|
||||||
if (e.defaultPrevented) {
|
if (e.defaultPrevented) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (editableDomainObject) {
|
|
||||||
$scope.setEditable(editableDomainObject);
|
|
||||||
}
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// Store the position of this element.
|
// Store the position of this element.
|
||||||
addElement({
|
addElement({
|
||||||
|
@ -60,15 +60,11 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Position a panel after a drop event
|
// Position a panel after a drop event
|
||||||
//An editableDomainObject is provided, as the drop may have
|
function handleDrop(e, id, position) {
|
||||||
// triggered a transition to edit mode.
|
|
||||||
function handleDrop(e, id, position, editableDomainObject) {
|
|
||||||
if (e.defaultPrevented) {
|
if (e.defaultPrevented) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (editableDomainObject) {
|
|
||||||
$scope.setEditable(editableDomainObject);
|
|
||||||
}
|
|
||||||
// Ensure that configuration field is populated
|
// Ensure that configuration field is populated
|
||||||
$scope.configuration = $scope.configuration || {};
|
$scope.configuration = $scope.configuration || {};
|
||||||
// Make sure there is a "panels" field in the
|
// Make sure there is a "panels" field in the
|
||||||
|
@ -40,12 +40,13 @@ define(
|
|||||||
*/
|
*/
|
||||||
function DropGesture(dndService, $q, element, domainObject) {
|
function DropGesture(dndService, $q, element, domainObject) {
|
||||||
var actionCapability = domainObject.getCapability('action'),
|
var actionCapability = domainObject.getCapability('action'),
|
||||||
scope = element.scope && element.scope(),
|
|
||||||
action; // Action for the drop, when it occurs
|
action; // Action for the drop, when it occurs
|
||||||
|
|
||||||
function broadcastDrop(id, event) {
|
function broadcastDrop(id, event) {
|
||||||
// Find the relevant scope...
|
// Find the relevant scope...
|
||||||
var rect;
|
var rect,
|
||||||
|
scope = element.scope && element.scope();
|
||||||
|
|
||||||
if (scope && scope.$broadcast) {
|
if (scope && scope.$broadcast) {
|
||||||
// Get the representation's bounds, to convert
|
// Get the representation's bounds, to convert
|
||||||
// drop position
|
// drop position
|
||||||
|
Reference in New Issue
Block a user