Improving new study browser and moving studies services to ohif:studies
This commit is contained in:
1 parent
0b51a53976
commit
eb372bed03
54 files changed
+560
-495
No files matched your search
@@ -3,3 +3,4 @@ import './bootstrap';
|
||||
import './playground/playground.html';
|
||||
import './playground/playground.styl';
|
||||
import './playground/playground.js';
|
||||
import './scrollArea';
|
||||
@@ -0,0 +1,2 @@
|
||||
import './scrollArea.html';
|
||||
import './scrollArea.js';
|
||||
@@ -0,0 +1,7 @@
|
||||
<template name="scrollArea">
|
||||
<div class="scroll-area {{this.class}}">
|
||||
<div class="scrollable {{#if instance.config.scrollX}}scroll-x{{/if}} {{#if instance.config.scrollY}}scroll-y{{/if}}">
|
||||
{{>Template.contentBlock}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { _ } from 'meteor/underscore';
|
||||
|
||||
Template.scrollArea.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
const { data } = instance;
|
||||
const defaultConfig = {
|
||||
hideScrollbar: true,
|
||||
scrollY: true,
|
||||
scrollX: false
|
||||
};
|
||||
|
||||
instance.config = _.defaults(data || {}, defaultConfig);
|
||||
});
|
||||
|
||||
Template.scrollArea.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
const { config } = instance;
|
||||
if (config.hideScrollbar) {
|
||||
const $scrollable = instance.$('.scrollable').first();
|
||||
const scrollable = $scrollable[0];
|
||||
const x = config.scrollX ? 1 : 0;
|
||||
const y = config.scrollY ? 1 : 0;
|
||||
$scrollable.css({
|
||||
right: 0 - (scrollable.offsetWidth - scrollable.clientWidth) * y,
|
||||
bottom: 0 - (scrollable.offsetHeight - scrollable.clientHeight) * x
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user