mirror of
https://github.com/nasa/openmct.git
synced 2025-04-15 23:16:46 +00:00
Modified dirty function
This commit is contained in:
parent
44f4a82fa1
commit
c305fba0a7
@ -112,7 +112,7 @@ define(
|
||||
* modifications since the last persist, false otherwise.
|
||||
*/
|
||||
EditorCapability.prototype.dirty = function () {
|
||||
return (this.domainObject.getModel().modified || 0) > (this.domainObject.getModel().persisted || 0);
|
||||
return this.transactionService.size() > 0;
|
||||
};
|
||||
|
||||
return EditorCapability;
|
||||
|
@ -140,5 +140,9 @@ define(
|
||||
});
|
||||
};
|
||||
|
||||
TransactionService.prototype.size = function () {
|
||||
return this.onCommits.length + this.onCancels.length;
|
||||
};
|
||||
|
||||
return TransactionService;
|
||||
});
|
||||
|
@ -86,10 +86,7 @@ define([
|
||||
"implementation": DropGesture,
|
||||
"depends": [
|
||||
"dndService",
|
||||
"$q",
|
||||
"navigationService",
|
||||
"instantiate",
|
||||
"typeService"
|
||||
"$q"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ define(
|
||||
* @param {DomainObject} domainObject the domain object whose
|
||||
* 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'),
|
||||
scope = element.scope && element.scope(),
|
||||
action; // Action for the drop, when it occurs
|
||||
@ -70,8 +70,6 @@ define(
|
||||
}
|
||||
|
||||
function dragOver(e) {
|
||||
actionCapability = domainObject.getCapability('action');
|
||||
|
||||
var event = (e || {}).originalEvent || e,
|
||||
selectedObject = dndService.getData(
|
||||
GestureConstants.MCT_EXTENDED_DRAG_TYPE
|
||||
@ -105,8 +103,7 @@ define(
|
||||
e.preventDefault();
|
||||
|
||||
//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') {
|
||||
domainObject.getCapability('action').perform('edit');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user