diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 62025e44..6401bf6b 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -100,7 +100,8 @@ $navbar-inverse-toggle-border-color: #512da8; @import "components/avatars", "components/buttons", -"components/jumbotron"; +"components/jumbotron", +"components/question"; body { padding-top: 50px; } diff --git a/app/assets/stylesheets/components/_question.scss b/app/assets/stylesheets/components/_question.scss new file mode 100644 index 00000000..3b2af72b --- /dev/null +++ b/app/assets/stylesheets/components/_question.scss @@ -0,0 +1,14 @@ +.question { + &--fixed { + position: fixed; + width: 100%; + z-index: 999; + } + + &--hidden { + visibility: hidden; + position: relative; + box-shadow: none; + z-index: -1; + } +} \ No newline at end of file diff --git a/app/assets/stylesheets/scss/panel.scss b/app/assets/stylesheets/scss/panel.scss index 91c39e4f..7ae74344 100644 --- a/app/assets/stylesheets/scss/panel.scss +++ b/app/assets/stylesheets/scss/panel.scss @@ -12,28 +12,3 @@ .panel-primary .answerbox--question-text { color: #fff; } - -#questions .panel-body .media { - &, .media-body { - overflow: visible; - } -} - -.panel-question { - position: fixed; - border-top: 1px solid #fff; - width: 100%; - z-index: 999; - border-color: #fff; -} - -.panel-question.question-hidden { - visibility: hidden; - position: relative; - box-shadow: none; - z-index: -1; -} - -.answerbox--question-media, .question-media, .question-body { - overflow: visible !important; -} diff --git a/app/views/shared/_question_header.haml b/app/views/question/_question.haml similarity index 92% rename from app/views/shared/_question_header.haml rename to app/views/question/_question.haml index 1eadf01d..456d79fa 100644 --- a/app/views/shared/_question_header.haml +++ b/app/views/question/_question.haml @@ -1,4 +1,4 @@ -.card.card-question{class: if hidden then 'question-hidden' end, tabindex: if hidden then '-1' end, aria: { hidden: if hidden then :true end }} +.card.question--fixed{class: if hidden then 'question--hidden' end, tabindex: if hidden then '-1' end, aria: { hidden: if hidden then :true end }} .container .card-body .media.question-media diff --git a/app/views/question/show.html.haml b/app/views/question/show.haml similarity index 84% rename from app/views/question/show.html.haml rename to app/views/question/show.haml index 224bb758..3460c3fe 100644 --- a/app/views/question/show.html.haml +++ b/app/views/question/show.haml @@ -1,9 +1,7 @@ - provide(:title, question_title(@question)) -= render 'shared/question_header', question: @question, hidden: false -= render 'shared/question_header', question: @question, hidden: true += render 'question', question: @question, hidden: false += render 'question', question: @question, hidden: true .container.question-page - / TODO: make this pretty (it's currently C-c'd straight from shared/_answerbox) - #answers - @answers.each do |a| = render 'answerbox', a: a, show_question: false