Fixed JSLint errors
This commit is contained in:
@@ -48,7 +48,7 @@ define(
|
|||||||
|
|
||||||
action.getActions = function(domainObject) {
|
action.getActions = function(domainObject) {
|
||||||
return actionCapability.getActions(domainObject).filter(function(action){
|
return actionCapability.getActions(domainObject).filter(function(action){
|
||||||
return !(DISALLOWED_ACTIONS.indexOf(action.getMetadata().key) >= 0);
|
return DISALLOWED_ACTIONS.indexOf(action.getMetadata().key) >= 0 ? false : true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -128,8 +128,9 @@ define(
|
|||||||
|
|
||||||
model.type = typeKey;
|
model.type = typeKey;
|
||||||
newPanel = new EditableDomainObject(instantiate(model, id), $q);
|
newPanel = new EditableDomainObject(instantiate(model, id), $q);
|
||||||
if (!canCompose(newPanel, selectedObject))
|
if (!canCompose(newPanel, selectedObject)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
[base.getId(), selectedObject.getId()].forEach(function(id){
|
[base.getId(), selectedObject.getId()].forEach(function(id){
|
||||||
newPanel.getCapability('composition').add(id);
|
newPanel.getCapability('composition').add(id);
|
||||||
@@ -151,35 +152,30 @@ define(
|
|||||||
domainObjectType = editableDomainObject.getModel().type,
|
domainObjectType = editableDomainObject.getModel().type,
|
||||||
selectedObject = dndService.getData(
|
selectedObject = dndService.getData(
|
||||||
GestureConstants.MCT_EXTENDED_DRAG_TYPE
|
GestureConstants.MCT_EXTENDED_DRAG_TYPE
|
||||||
);;
|
);
|
||||||
|
|
||||||
// If currently in edit mode allow drag and drop gestures to the
|
// Handle the drop; add the dropped identifier to the
|
||||||
// domain object. An exception to this is folders which have drop
|
// destination domain object's composition, and persist
|
||||||
// gestures in browse mode.
|
// the change.
|
||||||
//if (domainObjectType === 'folder' || domainObject.hasCapability('editor')) {
|
if (id) {
|
||||||
|
if (shouldCreateVirtualPanel(domainObject, selectedObject)){
|
||||||
// Handle the drop; add the dropped identifier to the
|
editableDomainObject = createVirtualPanel(domainObject, selectedObject);
|
||||||
// destination domain object's composition, and persist
|
if (editableDomainObject) {
|
||||||
// the change.
|
navigationService.setNavigation(editableDomainObject);
|
||||||
if (id) {
|
broadcastDrop(id, event);
|
||||||
if (shouldCreateVirtualPanel(domainObject, selectedObject)){
|
editableDomainObject.getCapability('status').set('editing', true);
|
||||||
if (editableDomainObject = createVirtualPanel(domainObject, selectedObject)) {
|
|
||||||
navigationService.setNavigation(editableDomainObject);
|
|
||||||
broadcastDrop(id, event);
|
|
||||||
editableDomainObject.getCapability('status').set('editing', true);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$q.when(action && action.perform()).then(function (result) {
|
|
||||||
//Don't go into edit mode for folders
|
|
||||||
if (domainObjectType!=='folder') {
|
|
||||||
navigationService.setNavigation(editableDomainObject);
|
|
||||||
}
|
|
||||||
broadcastDrop(id, event);
|
|
||||||
editableDomainObject.getCapability('status').set('editing', true);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$q.when(action && action.perform()).then(function (result) {
|
||||||
|
//Don't go into edit mode for folders
|
||||||
|
if (domainObjectType!=='folder') {
|
||||||
|
navigationService.setNavigation(editableDomainObject);
|
||||||
|
}
|
||||||
|
broadcastDrop(id, event);
|
||||||
|
editableDomainObject.getCapability('status').set('editing', true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
//}
|
}
|
||||||
// TODO: Alert user if drag and drop is not allowed
|
// TODO: Alert user if drag and drop is not allowed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user