Resolved merge conflicts

This commit is contained in:
Henry
2016-05-12 16:14:31 -07:00
parent 5bf750c90c
commit 44f4a82fa1
37 changed files with 741 additions and 332 deletions

View File

@@ -53,9 +53,7 @@ define(
* @param {ViewDefinition[]} views an array of view extensions
*/
function MCTRepresentation(representations, views, representers, $q, templateLinker, $log) {
var representationMap = {},
listeners = 0;
domainObjectListener;
var representationMap = {};
// Assemble all representations and views
// The distinction between views and representations is
@@ -250,10 +248,10 @@ define(
}
/**
* Add a listener for status changes to the object itself.
* Add a listener to the object for status changes.
*/
$scope.$watch("domainObject", function(domainObject, oldDomainObject) {
if (domainObject!==oldDomainObject){
$scope.$watch("domainObject", function (domainObject, oldDomainObject) {
if (domainObject !== oldDomainObject){
listenForStatusChange(domainObject);
}
});

View File

@@ -103,13 +103,18 @@ define(
// the change.
if (id) {
e.preventDefault();
if (domainObjectType!=='folder') {
domainObject.getCapability('action').perform('edit');
}
//Use scope.apply, drop event is outside digest cycle
// and if not applied here causes visual artifacts.
scope.$apply( function() {
if (domainObjectType !== 'folder') {
domainObject.getCapability('action').perform('edit');
}
});
$q.when(action && action.perform()).then(function () {
broadcastDrop(id, event);
});
}
}

View File

@@ -36,6 +36,7 @@ define(
testViews,
testUrls,
mockRepresenters,
mockStatusCapability,
mockQ,
mockLinker,
mockLog,
@@ -118,6 +119,8 @@ define(
mockChangeTemplate = jasmine.createSpy('changeTemplate');
mockLog = jasmine.createSpyObj("$log", LOG_FUNCTIONS);
mockStatusCapability = jasmine.createSpyObj("statusCapability", ["listen"]);
mockScope = jasmine.createSpyObj("scope", [ "$watch", "$on" ]);
mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS);
mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
@@ -128,6 +131,10 @@ define(
return testUrls[ext.key];
});
mockDomainObject.getCapability.andCallFake(function (c) {
return c === 'status' && mockStatusCapability;
});
mctRepresentation = new MCTRepresentation(
testRepresentations,
testViews,