Disabling save button after success when saving

This commit is contained in:
Bruno Alves de Faria 2017-03-16 23:22:06 -03:00
parent e12fb0de35
commit 074186beb5
4 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,4 @@
@import "{ohif:design}/app"
@require "{ohif:design}/app"
body>.header

View File

@ -7,7 +7,7 @@ Meteor.startup(function() {
OHIF.studylist.callbacks.middleClickOnStudy = dblClickOnStudy;
OHIF.studylist.timepointApi = new OHIF.measurements.TimepointApi();
OHIF.studylist.timepointApi.retrieveTimepoints();
OHIF.studylist.timepointApi.retrieveTimepoints({});
});
/**

View File

@ -65,7 +65,7 @@ class TimepointApi {
OHIF.log.info('Disassociation completed');
this.timepoints.remove({});
this.retrieveTimepoints();
this.retrieveTimepoints({});
});
}

View File

@ -1,6 +1,7 @@
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import { Session } from 'meteor/session';
import { Tracker } from 'meteor/tracker';
import { OHIF } from 'meteor/ohif:core';
Template.caseProgress.onCreated(() => {
@ -10,11 +11,13 @@ Template.caseProgress.onCreated(() => {
instance.progressText = new ReactiveVar();
instance.isLocked = new ReactiveVar();
instance.path = 'viewer.studyViewer.measurements';
instance.saveObserver = new Tracker.Dependency();
instance.saveData = () => {
// Clear signaled unsaved changes...
const successHandler = () => {
OHIF.ui.unsavedChanges.clear(`${instance.path}.*`);
instance.saveObserver.changed();
};
// Display the error messages
@ -165,7 +168,10 @@ Template.caseProgress.helpers({
},
isFinishDisabled() {
// Run this computation every time any measurement / timepoint suffer changes
const instance = Template.instance();
// Run this computation on save or every time any measurement / timepoint suffer changes
instance.saveObserver.depend();
Session.get('LayoutManagerUpdated');
return OHIF.ui.unsavedChanges.probe('viewer.*') === 0;