From 7eb348b8f4cecf6d7282e07f601428ec629e57d7 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Sun, 7 Dec 2014 13:40:49 +0200 Subject: typeselection: now in index.html (removed typeselection td padding) --- index.html | 7 ++++--- res/css/partials/input-bubble.scss | 4 +--- res/css/style.css | 4 ---- src/textanalysis.ui.js | 31 ++++++++++++++++++++++--------- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/index.html b/index.html index 2ebe90a3..a97f7d4c 100644 --- a/index.html +++ b/index.html @@ -77,10 +77,11 @@ -
+ diff --git a/res/css/partials/input-bubble.scss b/res/css/partials/input-bubble.scss index 2d581f9a..657e95de 100644 --- a/res/css/partials/input-bubble.scss +++ b/res/css/partials/input-bubble.scss @@ -8,10 +8,8 @@ } .typeselection td{ - padding-top: 5px; - padding-left: 200px; } #keys{ opacity: 0.5; -} \ No newline at end of file +} diff --git a/res/css/style.css b/res/css/style.css index ac929313..4ca40557 100644 --- a/res/css/style.css +++ b/res/css/style.css @@ -429,10 +429,6 @@ body.debug .debug-ui-right { top: -300px; pointer-events: none; } -.typeselection td { - padding-top: 5px; - padding-left: 200px; } - #keys { opacity: 0.5; } diff --git a/src/textanalysis.ui.js b/src/textanalysis.ui.js index cc9739b1..4f4ec261 100644 --- a/src/textanalysis.ui.js +++ b/src/textanalysis.ui.js @@ -12,27 +12,40 @@ var text = "", // Last text of sentence var typeselection = function TypeSelectionDialog() { var e = $('.typeselection'), + e_intro = e.find('#intro'), + e_label = e.find('#chosentypelabel'), + e_name = e.find('#chosentypename'), + e_desc = e.find('#chosentypedesc'), typeselection = {}; typeselection.analysisNodeStart = function() { typeselection.show(); - e.html('
Use [TAB] key to pick a type
'); } typeselection.show = function() { e.css({ - top: window.innerHeight/2-115, - left: window.innerWidth/2-325}); + top: window.innerHeight / 2 - 115, + left: window.innerWidth / 2 - 325 + }); + e_label.hide(); + e_desc.hide(); + e_intro.show(); + e.show(); } typeselection.hide = function() { - e.css('top', -300); - e.css('left', 0); + e.hide(); } typeselection.showChosenType = function(nodetype) { var desc = description[nodetype]; - e.html('' + - (desc ? '' : '') + - '
' + - "Chosen Type: " + nodetype + '
' + desc + '
'); + + e_intro.hide(); + e_label.show(); + e_name.html(nodetype); + if (desc) { + e_desc.html(description[nodetype]); + e_desc.show(); + } else { + e_desc.hide(); + } } return typeselection; }(); -- cgit v1.3.1