mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +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:
commit
5b6ea600ba
@ -91,14 +91,8 @@ define(
|
||||
}
|
||||
}
|
||||
|
||||
function setEditable(editableDomainObject) {
|
||||
self.domainObject = editableDomainObject;
|
||||
scope.model = editableDomainObject.getModel();
|
||||
}
|
||||
|
||||
// Place the "commit" method in the scope
|
||||
scope.commit = commit;
|
||||
scope.setEditable = setEditable;
|
||||
|
||||
// Clean up when the scope is destroyed
|
||||
scope.$on("$destroy", function () {
|
||||
|
@ -71,9 +71,6 @@ define([
|
||||
"uses": [
|
||||
"composition"
|
||||
],
|
||||
"gestures": [
|
||||
"drop"
|
||||
],
|
||||
"toolbar": {
|
||||
"sections": [
|
||||
{
|
||||
|
@ -271,15 +271,13 @@ define(
|
||||
}
|
||||
|
||||
// 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
|
||||
// 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({
|
||||
|
@ -60,15 +60,11 @@ define(
|
||||
}
|
||||
|
||||
// Position a panel after a drop event
|
||||
//An editableDomainObject is provided, as the drop may have
|
||||
// triggered a transition to edit mode.
|
||||
function handleDrop(e, id, position, editableDomainObject) {
|
||||
function handleDrop(e, id, position) {
|
||||
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
|
||||
|
@ -40,12 +40,13 @@ define(
|
||||
*/
|
||||
function DropGesture(dndService, $q, element, domainObject) {
|
||||
var actionCapability = domainObject.getCapability('action'),
|
||||
scope = element.scope && element.scope(),
|
||||
action; // Action for the drop, when it occurs
|
||||
|
||||
function broadcastDrop(id, event) {
|
||||
// Find the relevant scope...
|
||||
var rect;
|
||||
var rect,
|
||||
scope = element.scope && element.scope();
|
||||
|
||||
if (scope && scope.$broadcast) {
|
||||
// Get the representation's bounds, to convert
|
||||
// drop position
|
||||
|
Loading…
x
Reference in New Issue
Block a user