Removing progressDialog from DOM
This commit is contained in:
1 parent
cb2d0d18aa
commit
c7f31ddb0a
11 files changed
+186
-313
No files matched your search
@@ -1,4 +1,3 @@
|
||||
import './progressDialog';
|
||||
import './seriesDetailsModal';
|
||||
import './serverInformation';
|
||||
import './studyContextMenu';
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import './progressDialog.html';
|
||||
import './progressDialog.styl';
|
||||
import './progressDialog.js';
|
||||
@@ -1,18 +0,0 @@
|
||||
<template name="progressDialog">
|
||||
<div id="progressDialog" tabindex="0">
|
||||
<div class="dialogHeader">
|
||||
<h5>{{progressDialogTitle}}</h5>
|
||||
</div>
|
||||
<div class="dialogContent">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-striped active"
|
||||
role="progressbar"
|
||||
style="width: {{progressStatus}}%"
|
||||
>{{formatNumberPrecision progressStatus 0}}%</div>
|
||||
</div>
|
||||
<div id="message">
|
||||
{{{progressMessage}}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -1,78 +0,0 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Session } from 'meteor/session';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
const updateProgress = numberOfCompleted => {
|
||||
const progressDialogSettings = Session.get('progressDialogSettings');
|
||||
progressDialogSettings.numberOfCompleted = numberOfCompleted;
|
||||
|
||||
Session.set('progressDialogSettings', progressDialogSettings);
|
||||
|
||||
if (progressDialogSettings.numberOfCompleted === progressDialogSettings.numberOfTotal) {
|
||||
OHIF.studylist.progressDialog.close();
|
||||
}
|
||||
};
|
||||
|
||||
const setProgressMessage = message => {
|
||||
let progressDialogSettings = Session.get('progressDialogSettings');
|
||||
progressDialogSettings.message = message;
|
||||
Session.set('progressDialogSettings', progressDialogSettings);
|
||||
};
|
||||
|
||||
OHIF.studylist.progressDialog = {
|
||||
update: _.debounce(updateProgress, 100),
|
||||
setMessage: _.debounce(setProgressMessage, 100),
|
||||
show: function(title, numberOfTotal) {
|
||||
Session.set('progressDialogSettings', {
|
||||
title: title,
|
||||
numberOfCompleted: 0,
|
||||
numberOfTotal: numberOfTotal
|
||||
});
|
||||
|
||||
$('#progressDialog').css('display', 'block');
|
||||
},
|
||||
close: function() {
|
||||
Session.set('progressDialogSettings', {
|
||||
title: '',
|
||||
numberOfCompleted: 0,
|
||||
numberOfTotal: 1
|
||||
});
|
||||
|
||||
$('#progressDialog').css('display', 'none');
|
||||
}
|
||||
};
|
||||
|
||||
Template.progressDialog.helpers({
|
||||
progressDialogTitle() {
|
||||
const settings = Session.get('progressDialogSettings');
|
||||
if (!settings) {
|
||||
return;
|
||||
}
|
||||
|
||||
return settings.title;
|
||||
},
|
||||
|
||||
progressStatus() {
|
||||
const settings = Session.get('progressDialogSettings');
|
||||
if (!settings) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings.numberOfCompleted === undefined ||
|
||||
settings.numberOfTotal === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
return (settings.numberOfCompleted / settings.numberOfTotal) * 100;
|
||||
},
|
||||
|
||||
progressMessage() {
|
||||
const settings = Session.get('progressDialogSettings');
|
||||
if (!settings) {
|
||||
return;
|
||||
}
|
||||
|
||||
return settings.message;
|
||||
}
|
||||
});
|
||||
@@ -1,23 +0,0 @@
|
||||
#progressDialog
|
||||
display: none
|
||||
position: fixed
|
||||
left: 0
|
||||
right: 0
|
||||
margin: auto
|
||||
width: 20%
|
||||
min-height: 85px;
|
||||
z-index: 100
|
||||
border-radius: 5px
|
||||
padding: 10px 20px 10px 20px
|
||||
background-color: rgba(255,255,255,1)
|
||||
outline: none
|
||||
|
||||
.dialogContent
|
||||
margin-bottom: 20px
|
||||
|
||||
#message
|
||||
width: 100%
|
||||
|
||||
span
|
||||
display: inline-block;
|
||||
width: 100%
|
||||
@@ -2,7 +2,7 @@
|
||||
<div id="studylistTabs" class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="studylistTab">
|
||||
<div class="studylistContainer">
|
||||
{{> studylistResult (clone this)}}
|
||||
{{>studylistResult (clone this)}}
|
||||
</div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="viewerTab">
|
||||
@@ -11,7 +11,6 @@
|
||||
</div>
|
||||
</div>
|
||||
{{#each templateName in additionalTemplates}}
|
||||
{{> UI.dynamic template=templateName}}
|
||||
{{>Template.dynamic template=templateName}}
|
||||
{{/each}}
|
||||
{{>progressDialog}}
|
||||
</template>
|
||||
+9
-9
@@ -1,12 +1,12 @@
|
||||
<template name="studylistToolbar">
|
||||
<div class='studylistToolbar'>
|
||||
{{#if importSupported }}
|
||||
<div class="addNewStudy btn-file">
|
||||
<label for="btnImport">
|
||||
<i class="fa fa-plus"></i> Import study
|
||||
</label>
|
||||
<input id="btnImport" class='js-import-files' type="file" webkitdirectory directory multiple>
|
||||
</div>
|
||||
{{/if }}
|
||||
{{#if importSupported}}
|
||||
<div class="addNewStudy btn-file">
|
||||
<label for="btnImport">
|
||||
<i class="fa fa-plus"></i> Import study
|
||||
</label>
|
||||
<input id="btnImport" class='js-import-files' type="file" webkitdirectory directory multiple>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
+1
-1
@@ -19,7 +19,7 @@ Template.studylistToolbar.events({
|
||||
// Get selected files located in the client machine
|
||||
const selectedFiles = $.map(event.currentTarget.files, value => value);
|
||||
|
||||
importStudies(selectedFiles);
|
||||
OHIF.studylist.importStudies(selectedFiles);
|
||||
},
|
||||
|
||||
'click .js-import-files'(event) {
|
||||
|
||||
Reference in new issue
Block a user