Resolved merge conflicts
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user