LT-381: Disabling save button until there are unsaved changes
This commit is contained in:
parent
9fc538d5d4
commit
3eae1c6878
@ -10,7 +10,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if progressComplete}}
|
{{#if progressComplete}}
|
||||||
<div class="caseProgressStatus">
|
<div class="caseProgressStatus">
|
||||||
<button class="btn js-finish-case">Save</button>
|
<button class="btn js-finish-case {{valueIf isFinishDisabled 'disabled' ''}}">Save</button>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { Template } from 'meteor/templating';
|
import { Template } from 'meteor/templating';
|
||||||
import { ReactiveVar } from 'meteor/reactive-var';
|
import { ReactiveVar } from 'meteor/reactive-var';
|
||||||
|
import { Session } from 'meteor/session';
|
||||||
import { OHIF } from 'meteor/ohif:core';
|
import { OHIF } from 'meteor/ohif:core';
|
||||||
|
|
||||||
Template.caseProgress.onCreated(() => {
|
Template.caseProgress.onCreated(() => {
|
||||||
@ -150,6 +151,13 @@ Template.caseProgress.helpers({
|
|||||||
|
|
||||||
const progressPercent = instance.progressPercent.get();
|
const progressPercent = instance.progressPercent.get();
|
||||||
return progressPercent === 100;
|
return progressPercent === 100;
|
||||||
|
},
|
||||||
|
|
||||||
|
isFinishDisabled() {
|
||||||
|
// Run this computation every time any measurement / timepoint suffer changes
|
||||||
|
Session.get('LayoutManagerUpdated');
|
||||||
|
|
||||||
|
return OHIF.ui.unsavedChanges.probe('viewer.*') === 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user