LT-275: Creating 3 columns layout for open source version
This commit is contained in:
parent
ed918c9d32
commit
394678c04e
@ -146,7 +146,6 @@ $gray6 = #303030
|
|||||||
|
|
||||||
&.active
|
&.active
|
||||||
box-shadow: 0 0 0 200px white, inset 0 0 0 200px white
|
box-shadow: 0 0 0 200px white, inset 0 0 0 200px white
|
||||||
position: fixed
|
|
||||||
transition(box-shadow 0.3s ease)
|
transition(box-shadow 0.3s ease)
|
||||||
z-index: 0
|
z-index: 0
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template name="measureFlow">
|
<template name="measureFlow">
|
||||||
<div class="measure-flow {{instance.state.get}}" style="position:fixed; top:200px; left:400px">
|
<div class="measure-flow {{#if this.treeColumns}}tree-columns{{/if}} {{instance.state.get}}" style="position:fixed; top:200px; left:400px">
|
||||||
<button class="btn-add">Add label</button>
|
<button class="btn-add">Add label</button>
|
||||||
{{#if eq instance.state.get 'selected'}}
|
{{#if eq instance.state.get 'selected'}}
|
||||||
<div class="tree-leaf">
|
<div class="tree-leaf">
|
||||||
|
|||||||
@ -119,6 +119,7 @@ Template.measureFlow.events({
|
|||||||
label: 'Assign label',
|
label: 'Assign label',
|
||||||
searchPlaceholder: 'Search labels',
|
searchPlaceholder: 'Search labels',
|
||||||
storageKey: 'measureLabelCommon',
|
storageKey: 'measureLabelCommon',
|
||||||
|
treeColumns: instance.data.treeColumns,
|
||||||
position
|
position
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -206,14 +207,14 @@ Template.measureFlow.events({
|
|||||||
// Change the measure flow state to selected
|
// Change the measure flow state to selected
|
||||||
instance.state.set('selected');
|
instance.state.set('selected');
|
||||||
|
|
||||||
|
// Get the clicked label window offset
|
||||||
|
const labelOffset = $label.offset();
|
||||||
|
|
||||||
// Wait for the DOM re-rendering
|
// Wait for the DOM re-rendering
|
||||||
Tracker.afterFlush(() => {
|
Tracker.afterFlush(() => {
|
||||||
// Get the measure flow div
|
// Get the measure flow div
|
||||||
const $measureFlow = instance.$('.measure-flow');
|
const $measureFlow = instance.$('.measure-flow');
|
||||||
|
|
||||||
// Get the clicked label window offset
|
|
||||||
const labelOffset = $label.offset();
|
|
||||||
|
|
||||||
// Subtract the label box shadow height from the label's position
|
// Subtract the label box shadow height from the label's position
|
||||||
labelOffset.top -= 10;
|
labelOffset.top -= 10;
|
||||||
|
|
||||||
|
|||||||
@ -30,10 +30,6 @@
|
|||||||
width: 213px
|
width: 213px
|
||||||
|
|
||||||
&>.tree-options
|
&>.tree-options
|
||||||
margin-right: -17px
|
|
||||||
max-height: 250px
|
|
||||||
overflow-x: hidden
|
|
||||||
overflow-y: scroll
|
|
||||||
position: relative
|
position: relative
|
||||||
z-index: 2
|
z-index: 2
|
||||||
|
|
||||||
@ -120,3 +116,48 @@
|
|||||||
|
|
||||||
span
|
span
|
||||||
display: block
|
display: block
|
||||||
|
|
||||||
|
&.tree-columns
|
||||||
|
|
||||||
|
.select-tree-root
|
||||||
|
|
||||||
|
.select-tree-common
|
||||||
|
padding-left: 0
|
||||||
|
padding-right: 6px
|
||||||
|
right: auto
|
||||||
|
left: 0
|
||||||
|
width: 33.333333333333%
|
||||||
|
|
||||||
|
&>.tree-content
|
||||||
|
transform-origin(0% 50%)
|
||||||
|
width: 426px
|
||||||
|
|
||||||
|
.select-tree-common .content
|
||||||
|
right: -100%
|
||||||
|
|
||||||
|
&.started .select-tree-common .content
|
||||||
|
right: 6px
|
||||||
|
|
||||||
|
&.interacted .select-tree-common .content
|
||||||
|
animation-name: selectTreeCommonCloseRight
|
||||||
|
|
||||||
|
.tree-inputs>label
|
||||||
|
float: left
|
||||||
|
width: 50%
|
||||||
|
|
||||||
|
@keyframes selectTreeCommonCloseRight {
|
||||||
|
from {
|
||||||
|
height: 37px
|
||||||
|
display: table
|
||||||
|
right: 6px
|
||||||
|
opacity: 1
|
||||||
|
visibility: visible
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
height: 100%
|
||||||
|
right: -100%
|
||||||
|
opacity: 0
|
||||||
|
visibility: hidden
|
||||||
|
width: calc(100% - 6px)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
{{#if this.root}}
|
{{#if this.root}}
|
||||||
{{>selectTreeBreadcrumb component=this.component}}
|
{{>selectTreeBreadcrumb component=this.component}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="tree-inputs">
|
<div class="tree-inputs clearfix">
|
||||||
{{#each item in treeItems}}
|
{{#each item in treeItems}}
|
||||||
{{>inputRadio
|
{{>inputRadio
|
||||||
id=(concat this.storageKey '_' (encodeId item.value))
|
id=(concat this.storageKey '_' (encodeId item.value))
|
||||||
|
|||||||
@ -25,7 +25,10 @@ Template.selectTree.onRendered(() => {
|
|||||||
instance.component = component;
|
instance.component = component;
|
||||||
|
|
||||||
// Set the margin to display the common section
|
// Set the margin to display the common section
|
||||||
$treeRoot.children('.tree-content').css('margin-right', $treeRoot.width());
|
const isTreeColumns = instance.data.treeColumns;
|
||||||
|
const marginProperty = isTreeColumns ? 'margin-left' : 'margin-right';
|
||||||
|
const marginWidth = isTreeColumns ? $treeRoot.width() / 2 : $treeRoot.width();
|
||||||
|
$treeRoot.children('.tree-content').css(marginProperty, marginWidth);
|
||||||
|
|
||||||
// Make the component respect the window boundaries
|
// Make the component respect the window boundaries
|
||||||
$treeRoot.bounded();
|
$treeRoot.bounded();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template name="componentPlayground">
|
<template name="componentPlayground">
|
||||||
<div class="component-playground">
|
<div class="component-playground">
|
||||||
{{>measureFlow}}
|
{{>measureFlow treeColumns=true}}
|
||||||
<!--
|
<!--
|
||||||
<div class="p-a-3">
|
<div class="p-a-3">
|
||||||
{{>selectTree
|
{{>selectTree
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user