From c4c5e1d0d83798cdcf365a789969ecca9f7a29a1 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Wed, 1 Mar 2017 21:38:06 -0800 Subject: [PATCH] select all button --- app/assets/stylesheets/application.scss.erb | 55 ++++++++++++--------- app/views/shared/_switchmetacodes.html.erb | 5 +- frontend/src/Metamaps/Create.js | 1 + 3 files changed, 37 insertions(+), 24 deletions(-) diff --git a/app/assets/stylesheets/application.scss.erb b/app/assets/stylesheets/application.scss.erb index b16983df..065c26ab 100644 --- a/app/assets/stylesheets/application.scss.erb +++ b/app/assets/stylesheets/application.scss.erb @@ -2311,6 +2311,9 @@ and it won't be important on password protected instances */ } /* switch metacode set */ +#switchMetacodes > p { + margin: 16px 0 16px 0; +} #metacodeSwitchTabs { width: 100%; font-size: 17px; @@ -2318,28 +2321,36 @@ and it won't be important on password protected instances */ border: none; background: none; padding: 0; -} -#metacodeSwitchTabs .setDesc { - margin-bottom: 5px; - font-family: 'din-medium', helvetica, sans-serif; - color: #424242; - font-size: 14px; - text-align: justify; - padding-right: 16px; -} -#switchMetacodes > p { - margin: 16px 0 16px 0; -} -#metacodeSwitchTabs > ul { - width: 130px; -} -#metacodeSwitchTabs > ul li { - font-size: 14px; - text-transform: uppercase; -} -#metacodeSwitchTabs li.ui-state-active a { - color: #00BCD4; - cursor: pointer; + + .setDesc, + .selectAll { + margin-bottom: 5px; + font-family: 'din-medium', helvetica, sans-serif; + color: #424242; + font-size: 14px; + text-align: justify; + padding-right: 16px; + display: inline-block; + } + + .selectAll { + float: right; + cursor: pointer; + } + + & > ul { + width: 130px; + + li { + font-size: 14px; + text-transform: uppercase; + } + } + + li.ui-state-active a { + color: #00BCD4; + cursor: pointer; + } } .metacodeSwitchTab { max-height: 300px; diff --git a/app/views/shared/_switchmetacodes.html.erb b/app/views/shared/_switchmetacodes.html.erb index b5607065..a8db6f55 100644 --- a/app/views/shared/_switchmetacodes.html.erb +++ b/app/views/shared/_switchmetacodes.html.erb @@ -91,7 +91,8 @@ <% end %>
-

Choose Your Metacodes

+
Choose Your Metacodes
+
Select all
<%# hidden by default %> <% @list = '' %> <% metacodesInUse = user_metacodes() %> <% Metacode.order("name").all.each_with_index do |m, index| %> @@ -116,4 +117,4 @@ \ No newline at end of file + diff --git a/frontend/src/Metamaps/Create.js b/frontend/src/Metamaps/Create.js index f0f5e08a..d3bd9719 100644 --- a/frontend/src/Metamaps/Create.js +++ b/frontend/src/Metamaps/Create.js @@ -28,6 +28,7 @@ const Create = { }).addClass('ui-tabs-vertical ui-helper-clearfix') $('#metacodeSwitchTabs .ui-tabs-nav li').removeClass('ui-corner-top').addClass('ui-corner-left') $('.customMetacodeList li').click(self.toggleMetacodeSelected) // within the custom metacode set tab + $('.selectAll').click(self.metacodeSelectorToggleSelectAll) }, toggleMetacodeSelected: function() { var self = Create