Commit 94fccb00 by Kyle Fiedler

Added fixes for the sidebar, made better base style for inputs and brightened colors a bit

parent 985a5323
class @CMS
@setHeight = =>
windowHeight = $(this).height()
@contentHeight = windowHeight - 29
windowHeight = $(window).height()
headerHeight = $('body > header').outerHeight()
contentHeight = $('.main-content').height()
@sidebarHeight = if windowHeight > contentHeight then windowHeight - headerHeight else contentHeight - headerHeight
@minContentHeight = windowHeight - headerHeight
$('.cal').css('height', @sidebarHeight)
$('.main-content').css('min-height', @minContentHeight)
@bind = =>
$('a.module-edit').click ->
......@@ -13,8 +19,9 @@ class @CMS
$.get('/edit_item', {id: id}, (data) =>
$('#module-html').empty().append(data)
CMS.bind()
$('body.content .cal').css('height', @contentHeight)
CMS.setHeight()
$('body').addClass('content')
$('body.content .cal ol > li').css('height','auto')
$('section.edit-pane').show()
new Unit('unit-wrapper', id)
)
......@@ -31,6 +38,7 @@ $ ->
heighest = if $(this).height() > heighest then $(this).height() else heighest
$('.cal ol > li').css('height',heighest + 'px')
$('body.content .cal ol > li').css('height','auto')
$('.add-new-section').click -> return false
......@@ -43,40 +51,6 @@ $ ->
$(this).parent().parent().hide()
return false
# $('html').keypress ->
# $('.wip').css('visibility', 'visible')
setHeight = ->
windowHeight = $(this).height()
contentHeight = windowHeight - 29
$('section.main-content > section').css('min-height', contentHeight)
$('body.content .cal').css('height', contentHeight)
$('.edit-week').click ->
$('body').addClass('content')
$('body.content .cal').css('height', contentHeight)
$('section.edit-pane').show()
return false
$('a.week-edit').click ->
$('body').addClass('content')
$('body.content .cal').css('height', contentHeight)
$('section.edit-pane').show()
return false
$('a.sequence-edit').click ->
$('body').addClass('content')
$('body.content .cal').css('height', contentHeight)
$('section.edit-pane').show()
return false
$('a.module-edit').click ->
$('body.content .cal').css('height', contentHeight)
$(document).ready(setHeight)
$(window).bind('resize', setHeight)
$('.video-new a').click ->
$('section.edit-pane').show()
return false
......@@ -84,7 +58,7 @@ $ ->
$('.problem-new a').click ->
$('section.edit-pane').show()
return false
CMS.setHeight()
CMS.bind()
......@@ -32,11 +32,11 @@ input {
button, input[type="submit"], .button {
background-color: $orange;
color: #fff;
-webkit-font-smoothing: antialiased;
padding: 8px 10px;
border: 0;
color: #fff;
font-weight: bold;
padding: 8px 10px;
-webkit-font-smoothing: antialiased;
&:hover {
background-color: shade($orange, 10%);
......@@ -45,9 +45,22 @@ button, input[type="submit"], .button {
#{$all-text-inputs}, textarea {
border: 1px solid $dark-blue;
@include box-shadow(inset 0 3px 6px $light-blue);
color: lighten($dark-blue, 30%);
font: $body-font-size $body-font-family;
outline: none;
padding: 4px 6px;
@include box-shadow(inset 0 3px 6px $light-blue);
&:hover {
background: lighten($yellow, 13%);
color: $dark-blue;
}
&:focus {
@include box-shadow(inset 0 3px 6px $light-blue, 0 0 3px lighten($bright-blue, 10%));
color: $dark-blue;
background: lighten($yellow, 13%);
}
}
textarea {
......@@ -56,7 +69,6 @@ textarea {
line-height: lh();
padding: 15px;
width: 100%;
}
// Extends
......@@ -99,6 +111,7 @@ textarea {
&:hover {
background: lighten($yellow, 10%);
}
button {
padding: 4px 10px;
}
......
section.cal {
@include box-sizing(border-box);
padding: 25px;
@include clearfix;
padding: 25px;
> header {
@include clearfix;
......@@ -62,8 +62,8 @@ section.cal {
@include box-sizing(border-box);
float: left;
width: flex-grid(3) + ((flex-gutter() * 3) / 4);
background-color: lighten($light-blue, 2%);
background-color: $light-blue;
overflow-y: hidden;
header {
border-bottom: 1px solid lighten($dark-blue, 40%);
......@@ -90,10 +90,6 @@ section.cal {
color: #888;
border-bottom: 0;
font-size: 12px;
&:hover {
background: #fff;
}
}
}
}
......
......@@ -85,6 +85,8 @@ section#unit-wrapper {
}
&:hover {
background-color: lighten($yellow, 10%);
a.draggable {
opacity: 1;
}
......@@ -136,12 +138,16 @@ section#unit-wrapper {
li {
border-bottom: 1px solid darken($light-blue, 8%);
background: lighten($light-blue, 2%);
background: $light-blue;
&:last-child {
border-bottom: 0;
}
a {
color: $dark-blue;
}
ul {
list-style: none;
......@@ -153,6 +159,8 @@ section#unit-wrapper {
}
&:hover {
background-color: lighten($yellow, 10%);
a.draggable {
opacity: 1;
}
......@@ -172,13 +180,8 @@ section#unit-wrapper {
float: right;
opacity: .3;
}
a {
color: #000;
}
}
}
}
}
}
......
......@@ -41,7 +41,7 @@ section#unit-wrapper {
&.save-update {
@extend .button;
margin: -6px -25px -6px 0;
margin: -6px -21px -6px 0;
}
}
}
......
......@@ -3,16 +3,16 @@
<h2><a href="/">6.002x circuits and electronics</a></h2>
<ul>
<li>
<a href="#" class="new-module">New Section</a>
<a href="#" class="new-module wip">New Module</a>
</li>
<li>
<a href="#" class="new-module">New Unit</a>
<a href="#" class="new-module wip">New Unit</a>
</li>
</ul>
<ul class="user-nav">
<li><a href="#">Tasks</a></li>
<li><a href="#">Settings</a></li>
<li><a href="#" class="wip">Tasks</a></li>
<li><a href="#" class="wip">Settings</a></li>
</ul>
</nav>
</header>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment