From 38c01c4e8f0df3abb8c27d57bafc266636376b16 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Thu, 12 Jan 2017 12:19:54 -0500 Subject: [PATCH] fix the carousel --- app/assets/stylesheets/application.scss.erb | 4 ++-- frontend/src/Metamaps/Create.js | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/application.scss.erb b/app/assets/stylesheets/application.scss.erb index 341a4c77..b4b5455c 100644 --- a/app/assets/stylesheets/application.scss.erb +++ b/app/assets/stylesheets/application.scss.erb @@ -526,8 +526,8 @@ button.button.btn-no:hover { } .new_topic { - top: 50%; - left: 50%; + top: -10000px; + left: -10000px; margin-top: -17px; display: block; position: absolute; diff --git a/frontend/src/Metamaps/Create.js b/frontend/src/Metamaps/Create.js index 75e51116..05144bc0 100644 --- a/frontend/src/Metamaps/Create.js +++ b/frontend/src/Metamaps/Create.js @@ -23,9 +23,9 @@ const Create = { newSelectedMetacodes: [], recentMetacodes: [], mostUsedMetacodes: [], - init: function () { + init: function (serverData) { var self = Create - self.newTopic.init() + self.newTopic.init(serverData) self.newSynapse.init() // // SWITCHING METACODE SETS @@ -142,10 +142,12 @@ console.log(codesToSwitchToIds) $('#topic_name').focus() }, newTopic: { - init: function () { + init: function (serverData) { const DOWN_ARROW = 40 const ESC = 27 + if (!serverData.ActiveMapper) return + $('#topic_name').keyup(function (e) { Create.newTopic.name = $(this).val() @@ -218,7 +220,9 @@ console.log(codesToSwitchToIds) speed: 0.3, bringToFront: true }) - $('#new_topic').attr('oncontextmenu', 'return false') // prevents the mouse up event from opening the default context menu on this element + $('#new_topic').hide() + .css({ left: '50%', top: '50%' }) + .attr('oncontextmenu', 'return false') // prevents the mouse up event from opening the default context menu on this element }, name: null, newId: 1,