diff --git a/cms/static/coffee/main.coffee b/cms/static/coffee/main.coffee index 8f7d7d7323..bd4992930a 100644 --- a/cms/static/coffee/main.coffee +++ b/cms/static/coffee/main.coffee @@ -1,7 +1,13 @@ 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() diff --git a/cms/static/sass/_base.scss b/cms/static/sass/_base.scss index f9e9e13a1b..e9403dcffc 100644 --- a/cms/static/sass/_base.scss +++ b/cms/static/sass/_base.scss @@ -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; - font: $body-font-size $body-font-family; - padding: 4px 6px; @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; + + &: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; } diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss index 423afc5ab4..90fd767c68 100644 --- a/cms/static/sass/_calendar.scss +++ b/cms/static/sass/_calendar.scss @@ -1,7 +1,7 @@ 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; - } } } } diff --git a/cms/static/sass/_section.scss b/cms/static/sass/_section.scss index f0ac33ba53..dbd4f232b1 100644 --- a/cms/static/sass/_section.scss +++ b/cms/static/sass/_section.scss @@ -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; - } } } - } } } diff --git a/cms/static/sass/_unit.scss b/cms/static/sass/_unit.scss index a21a4bf7a2..b3a6debb57 100644 --- a/cms/static/sass/_unit.scss +++ b/cms/static/sass/_unit.scss @@ -41,7 +41,7 @@ section#unit-wrapper { &.save-update { @extend .button; - margin: -6px -25px -6px 0; + margin: -6px -21px -6px 0; } } } diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 4577ac64d8..bad314560b 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -3,16 +3,16 @@