Merge pull request #930 from nasa/open633

[New Edit Mode] #633 Remove Editing workflow concerns from FixedController, LayoutController
This commit is contained in:
Victor Woeltjen 2016-05-20 16:10:46 -07:00
commit 5b6ea600ba
5 changed files with 7 additions and 21 deletions

View File

@ -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 () {

View File

@ -71,9 +71,6 @@ define([
"uses": [
"composition"
],
"gestures": [
"drop"
],
"toolbar": {
"sections": [
{

View File

@ -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({

View File

@ -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

View File

@ -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