yank tips in favor of border and autofocus for item search

This commit is contained in:
Emi Matchu 2014-04-04 14:17:57 -05:00
parent 3650525671
commit 868bbcdd41
3 changed files with 11 additions and 40 deletions

View file

@ -163,7 +163,8 @@ View.Fullscreen = function (wardrobe) {
if(full) {
preview_swf = $('#preview-swf'); // swf replaced
var available = {
height: search_el.offset().top - preview_el.offset().top,
height: search_el.offset().top -
parseInt(search_el.css('marginTop'), 10) - preview_el.offset().top,
width: preview_el.innerWidth() - sidebar_el.outerWidth() - 12 // 12px margin
}, dim = {}, margin = {}, size = {
old: {height: preview_swf.height(), width: preview_swf.width()},
@ -189,7 +190,7 @@ View.Fullscreen = function (wardrobe) {
preview_el.height(available.height);
// If the footer goes onto two lines, nudge search up.
search_el.css('bottom', $('#footer').height());
search_el.css('bottom', footer.outerHeight(true));
// Now that preview is fit, we fit the sidebar's content element, which
// also has to deal with the constraint of its navbar's height.

View file

@ -238,8 +238,13 @@ body.outfits-edit
top: -9999px
width: 30em
#preview-search
+border-radius(8px)
border: 1px solid $soft-border-color
box-sizing: border-box
clear: both
padding-top: .5em
margin-bottom: .5em
margin-top: 1em
padding: .25em 1em .25em
text-align: left
h2
+inline-block
@ -253,35 +258,11 @@ body.outfits-edit
display: none
#preview-search-advanced
display: block
&.has-results
#tips
display: none
#preview-search-basic-main
clear: both
#preview-search-basic-main, #preview-search-advanced-main
#preview-search.has-results #preview-search-basic-main, #preview-search-advanced-main
/* don't bounce the header around kthx */
min-height: 180px
#tips
padding-top: .5em
li
box-sizing: border-box
display: none
list-style: none
margin: 0 auto
padding: 1em
position: relative
width: 600px
footer
color: $soft-text-color
font-size: 85%
position: absolute
right: 1em
top: 1.5em
a, span
margin-left: .5em
#preview-search-advanced
display: none

View file

@ -96,7 +96,7 @@
%form#preview-search-basic.item-search
%header
%h2= t '.search.header'
%input{:name => "query", :type => "search"}/
%input{:name => "query", :type => "search", autofocus: true}/
%input{:type => "submit", :value => t('.search.form.submit')}/
%a#preview-search-advanced-link{href: 'javascript:void(0)'}= t '.search.advanced.header'
%a#preview-search-form-clear{:href => "#"}= t '.search.form.clear'
@ -107,17 +107,6 @@
#preview-search-form-no-results
= t '.search.no_results_html', :query => content_tag(:span)
%ul#preview-search-results
#tips
%ul
- tips = WardrobeTip.by_index.all
- tips.each_with_index do |tip, index|
%li
%h3 Did you know?
%div= md tip.body
%footer
%a.prev{href: 'javascript:void(0)'} ← Prev
%span Tip #{index + 1} of #{tips.size}
%a.next{href: 'javascript:void(0)'} Next →
%form#preview-search-advanced
%header
%h2= t '.search.advanced.header'