mirror of
https://github.com/nasa/openmct.git
synced 2025-06-20 16:10:23 +00:00
Modified dirty function
This commit is contained in:
@ -112,7 +112,7 @@ define(
|
|||||||
* modifications since the last persist, false otherwise.
|
* modifications since the last persist, false otherwise.
|
||||||
*/
|
*/
|
||||||
EditorCapability.prototype.dirty = function () {
|
EditorCapability.prototype.dirty = function () {
|
||||||
return (this.domainObject.getModel().modified || 0) > (this.domainObject.getModel().persisted || 0);
|
return this.transactionService.size() > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
return EditorCapability;
|
return EditorCapability;
|
||||||
|
@ -140,5 +140,9 @@ define(
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TransactionService.prototype.size = function () {
|
||||||
|
return this.onCommits.length + this.onCancels.length;
|
||||||
|
};
|
||||||
|
|
||||||
return TransactionService;
|
return TransactionService;
|
||||||
});
|
});
|
||||||
|
@ -86,10 +86,7 @@ define([
|
|||||||
"implementation": DropGesture,
|
"implementation": DropGesture,
|
||||||
"depends": [
|
"depends": [
|
||||||
"dndService",
|
"dndService",
|
||||||
"$q",
|
"$q"
|
||||||
"navigationService",
|
|
||||||
"instantiate",
|
|
||||||
"typeService"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ define(
|
|||||||
* @param {DomainObject} domainObject the domain object whose
|
* @param {DomainObject} domainObject the domain object whose
|
||||||
* composition should be modified as a result of the drop.
|
* composition should be modified as a result of the drop.
|
||||||
*/
|
*/
|
||||||
function DropGesture(dndService, $q, navigationService, instantiate, typeService, element, domainObject) {
|
function DropGesture(dndService, $q, element, domainObject) {
|
||||||
var actionCapability = domainObject.getCapability('action'),
|
var actionCapability = domainObject.getCapability('action'),
|
||||||
scope = element.scope && element.scope(),
|
scope = element.scope && element.scope(),
|
||||||
action; // Action for the drop, when it occurs
|
action; // Action for the drop, when it occurs
|
||||||
@ -70,8 +70,6 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dragOver(e) {
|
function dragOver(e) {
|
||||||
actionCapability = domainObject.getCapability('action');
|
|
||||||
|
|
||||||
var event = (e || {}).originalEvent || e,
|
var event = (e || {}).originalEvent || e,
|
||||||
selectedObject = dndService.getData(
|
selectedObject = dndService.getData(
|
||||||
GestureConstants.MCT_EXTENDED_DRAG_TYPE
|
GestureConstants.MCT_EXTENDED_DRAG_TYPE
|
||||||
@ -105,8 +103,7 @@ define(
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
//Use scope.apply, drop event is outside digest cycle
|
//Use scope.apply, drop event is outside digest cycle
|
||||||
// and if not applied here causes visual artifacts.
|
scope.$apply(function () {
|
||||||
scope.$apply( function() {
|
|
||||||
if (domainObjectType !== 'folder') {
|
if (domainObjectType !== 'folder') {
|
||||||
domainObject.getCapability('action').perform('edit');
|
domainObject.getCapability('action').perform('edit');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user