Skip to content

Commit

Permalink
dropdown qa - #374, #375, #376, #377, #378
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidan Feay committed Jul 29, 2016
1 parent aba490c commit f7a8f46
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 24 deletions.
27 changes: 16 additions & 11 deletions app/assets/javascripts/autotune/application.js

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions app/assets/stylesheets/autotune/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -933,10 +933,7 @@ $nav-break: 550px;
width: auto;
}
.filters{
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
display: inline-block;
margin-left: 0px;
// .form-inline .form-control{
// @media (min-width: 768px){
Expand Down Expand Up @@ -984,6 +981,7 @@ $nav-break: 550px;
// margin: auto;
width:100%;
display: flex;
z-index: 1;
.pagination{
width: initial;
margin: 0 auto;
Expand Down
11 changes: 9 additions & 2 deletions app/assets/stylesheets/autotune/_custom_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ input#search{
float:right;
}

.filters .select {
margin-bottom: 5px;
}

.selectize-target,
.selectize-control {
z-index: 2;
}

.selectize-input {
min-width: 140px;
background-color: color(background);
color: color(text);
border: 2px solid color(border);
Expand Down Expand Up @@ -42,7 +45,11 @@ input#search{
}

.selectize-dropdown {
width: 100%;
width: -moz-fit-content !important;
width: -webkit-fit-content !important;
width: fit-content !important;
margin: auto;
z-index: 3;
.option {
text-align: left;
min-width: 100%;
Expand Down
10 changes: 5 additions & 5 deletions appjs/templates/project_list.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
<% if ( app.themes.length > 1 ) { %>
<div class="select">
<select name="theme" id="theme" class="form-control selectize-target" data-auto-submit="true" placeholder = "Search themes">
<select name="theme" id="theme" class="form-control selectize-target" data-auto-submit="true" placeholder="Theme">
<option disabled <% if(!query.theme) { %>selected<% } %>></option>
<% app.themes.each(function(theme) { %>
<option <% if(theme.get('slug') == query.theme) { %>selected<% } %>
Expand All @@ -39,17 +39,17 @@
</div>
<% } %>
<div class="select">
<select name="blueprint_title" id="blueprint_title" class="form-control" data-auto-submit="true">
<option disabled <% if(!query.blueprint_title) { %>selected<% } %>>Blueprint</option>
<select name="blueprint_title" id="blueprint_title" class="form-control selectize-target" data-auto-submit="true" placeholder="Blueprint">
<option disabled <% if(!query.blueprint_title) { %>selected<% } %>></option>
<% _.each(app.config.blueprint_titles, function(blueprint_title) { %>
<option <% if(String(blueprint_title.id) === query.blueprint_title) { %>selected<% } %>
value="<%=blueprint_title.id %>"><%=blueprint_title.title %></option>
<% }) %>
</select>
</div>
<div class="select">
<select name="pub_status" id="pub_status" class="form-control" data-auto-submit="true">
<option disabled <% if(!query.pub_status) { %>selected<% } %>>Status</option>
<select name="pub_status" id="pub_status" class="form-control selectize-target" data-auto-submit="true" placeholder="Status">
<option disabled <% if(!query.pub_status) { %>selected<% } %>></option>
<% _.each(app.config.project_pub_statuses, function(pub_status) { %>
<option <% if(pub_status === query.pub_status) { %>selected<% } %>
value="<%=pub_status %>"><%=pub_status %></option>
Expand Down
3 changes: 3 additions & 0 deletions appjs/views/edit_project.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ var EditProject = BaseView.extend(require('./mixins/actions'), require('./mixins
$( "input[name='google_doc_url']" ).after('<button type="button" id="spreadsheet-button" data-hook="create-spreadsheet" class="btn btn-default">Get new spreadsheet</button>');
}
}
$('div[data-alpaca-field-name="theme"] .form-control').selectize({
highlight: false
});
}).catch(function(err) {
console.error(err);
}).then(function() {
Expand Down
6 changes: 4 additions & 2 deletions appjs/views/list_projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ module.exports = BaseView.extend(require('./mixins/actions'), require('./mixins/
},

afterRender: function() {
$('.selectize-target').selectize({
highlight: false
$.each($('.selectize-target'), function(k, v){
$(v).selectize({
highlight: false
});
});
},

Expand Down

0 comments on commit f7a8f46

Please sign in to comment.