From dd9fa2b789b3ff1e845a1fe15033536bd7f77b60 Mon Sep 17 00:00:00 2001 From: Bruno Alves de Faria Date: Wed, 19 Oct 2016 09:06:40 +0100 Subject: [PATCH] LT-275: Improving add/edit description animations and behaviors --- .../ohif-design/styles/common/keyframes.styl | 4 ++ .../components/measureFlow/measureFlow.js | 50 +++---------------- 2 files changed, 11 insertions(+), 43 deletions(-) diff --git a/Packages/ohif-design/styles/common/keyframes.styl b/Packages/ohif-design/styles/common/keyframes.styl index 506b77b5c..779825b64 100644 --- a/Packages/ohif-design/styles/common/keyframes.styl +++ b/Packages/ohif-design/styles/common/keyframes.styl @@ -31,11 +31,15 @@ @keyframes fadeIn from opacity: 0 + visibility: hidden to opacity: 1 + visibility: visible @keyframes fadeOut from opacity: 1 + visibility: visible to opacity: 0 + visibility: hidden diff --git a/Packages/ohif-lesiontracker/client/components/measureFlow/measureFlow.js b/Packages/ohif-lesiontracker/client/components/measureFlow/measureFlow.js index f6df8dee1..e9504775d 100644 --- a/Packages/ohif-lesiontracker/client/components/measureFlow/measureFlow.js +++ b/Packages/ohif-lesiontracker/client/components/measureFlow/measureFlow.js @@ -1,7 +1,7 @@ -import { OHIF } from 'meteor/ohif:core'; import { Template } from 'meteor/templating'; import { Blaze } from 'meteor/blaze'; import { ReactiveVar } from 'meteor/reactive-var'; +import { Tracker } from 'meteor/tracker'; import { _ } from 'meteor/underscore'; import { $ } from 'meteor/jquery'; @@ -12,48 +12,6 @@ Template.measureFlow.onCreated(() => { instance.description = new ReactiveVar(''); instance.descriptionEdit = new ReactiveVar(false); - instance.items = [{ - label: 'Category 1', - value: 'Category 1', - items: [{ - label: 'Subcategory 1.1', - value: 'Subcategory 1.1' - }, { - label: 'Subcategory 1.2', - value: 'Subcategory 1.2', - items: [{ - label: 'Subcategory 1.2.1', - value: 'Subcategory 1.2.1' - }, { - label: 'Subcategory 1.2.2', - value: 'Subcategory 1.2.2', - items: [{ - label: 'Subcategory 1.2.2.1', - value: 'Subcategory 1.2.2.1' - }, { - label: 'Subcategory 1.2.2.2', - value: 'Subcategory 1.2.2.2' - }] - }] - }] - }, { - label: 'Category 2', - value: 'Category 2', - items: [{ - label: 'Subcategory 2.1', - value: 'Subcategory 2.1' - }, { - label: 'Subcategory 2.2', - value: 'Subcategory 2.2' - }, { - label: 'Subcategory 2.3', - value: 'Subcategory 2.3' - }] - }, { - label: 'Category 3', - value: 'Category 3' - }]; - const items = [ 'Abdomen/Chest Wall', 'Adrenal', @@ -195,6 +153,12 @@ Template.measureFlow.events({ } }, + 'blur textarea'(event, instance) { + instance.$('.measure-flow .actions').removeClass('fadeOut'); + instance.descriptionEdit.set(false); + instance.description.set($(event.currentTarget).val()); + }, + 'click .select-tree-common label'(event, instance) { // Set the common section clicked flag instance.commonClicked = true;