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
@@ -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