select all button

This commit is contained in:
Devin Howard 2017-03-01 21:38:06 -08:00
parent b8d99a2f9a
commit c4c5e1d0d8
3 changed files with 37 additions and 24 deletions

View file

@ -2311,6 +2311,9 @@ and it won't be important on password protected instances */
} }
/* switch metacode set */ /* switch metacode set */
#switchMetacodes > p {
margin: 16px 0 16px 0;
}
#metacodeSwitchTabs { #metacodeSwitchTabs {
width: 100%; width: 100%;
font-size: 17px; font-size: 17px;
@ -2318,28 +2321,36 @@ and it won't be important on password protected instances */
border: none; border: none;
background: none; background: none;
padding: 0; padding: 0;
}
#metacodeSwitchTabs .setDesc { .setDesc,
margin-bottom: 5px; .selectAll {
font-family: 'din-medium', helvetica, sans-serif; margin-bottom: 5px;
color: #424242; font-family: 'din-medium', helvetica, sans-serif;
font-size: 14px; color: #424242;
text-align: justify; font-size: 14px;
padding-right: 16px; text-align: justify;
} padding-right: 16px;
#switchMetacodes > p { display: inline-block;
margin: 16px 0 16px 0; }
}
#metacodeSwitchTabs > ul { .selectAll {
width: 130px; float: right;
} cursor: pointer;
#metacodeSwitchTabs > ul li { }
font-size: 14px;
text-transform: uppercase; & > ul {
} width: 130px;
#metacodeSwitchTabs li.ui-state-active a {
color: #00BCD4; li {
cursor: pointer; font-size: 14px;
text-transform: uppercase;
}
}
li.ui-state-active a {
color: #00BCD4;
cursor: pointer;
}
} }
.metacodeSwitchTab { .metacodeSwitchTab {
max-height: 300px; max-height: 300px;

View file

@ -91,7 +91,8 @@
</div> </div>
<% end %> <% end %>
<div id="metacodeSwitchTabsCustom"> <div id="metacodeSwitchTabsCustom">
<p class="setDesc">Choose Your Metacodes</p> <div class="setDesc">Choose Your Metacodes</div>
<div class="selectAll">Select all</div> <%# hidden by default %>
<% @list = '' %> <% @list = '' %>
<% metacodesInUse = user_metacodes() %> <% metacodesInUse = user_metacodes() %>
<% Metacode.order("name").all.each_with_index do |m, index| %> <% Metacode.order("name").all.each_with_index do |m, index| %>
@ -116,4 +117,4 @@
<script> <script>
Metamaps.Create.selectedMetacodeSet = "metacodeset-<%= selectedSet %>" Metamaps.Create.selectedMetacodeSet = "metacodeset-<%= selectedSet %>"
Metamaps.Create.selectedMetacodeSetIndex = <%= index %> Metamaps.Create.selectedMetacodeSetIndex = <%= index %>
</script> </script>

View file

@ -28,6 +28,7 @@ const Create = {
}).addClass('ui-tabs-vertical ui-helper-clearfix') }).addClass('ui-tabs-vertical ui-helper-clearfix')
$('#metacodeSwitchTabs .ui-tabs-nav li').removeClass('ui-corner-top').addClass('ui-corner-left') $('#metacodeSwitchTabs .ui-tabs-nav li').removeClass('ui-corner-top').addClass('ui-corner-left')
$('.customMetacodeList li').click(self.toggleMetacodeSelected) // within the custom metacode set tab $('.customMetacodeList li').click(self.toggleMetacodeSelected) // within the custom metacode set tab
$('.selectAll').click(self.metacodeSelectorToggleSelectAll)
}, },
toggleMetacodeSelected: function() { toggleMetacodeSelected: function() {
var self = Create var self = Create