From dbcad03ddd16c314f174080342db83cc116ec552 Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Mon, 9 Jul 2012 10:22:55 -0400 Subject: [PATCH] Added some fixes for some small things adn reset the js --- cms/static/coffee/main.coffee | 50 ++++++++++++++++++++------- cms/static/sass/_base.scss | 7 +++- cms/static/sass/_calendar.scss | 15 ++++---- cms/static/sass/_section.scss | 4 ++- cms/templates/widgets/navigation.html | 7 ++-- 5 files changed, 59 insertions(+), 24 deletions(-) diff --git a/cms/static/coffee/main.coffee b/cms/static/coffee/main.coffee index bd4992930a..8f7d7d7323 100644 --- a/cms/static/coffee/main.coffee +++ b/cms/static/coffee/main.coffee @@ -1,13 +1,7 @@ class @CMS @setHeight = => - 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) + windowHeight = $(this).height() + @contentHeight = windowHeight - 29 @bind = => $('a.module-edit').click -> @@ -19,9 +13,8 @@ class @CMS $.get('/edit_item', {id: id}, (data) => $('#module-html').empty().append(data) CMS.bind() - CMS.setHeight() + $('body.content .cal').css('height', @contentHeight) $('body').addClass('content') - $('body.content .cal ol > li').css('height','auto') $('section.edit-pane').show() new Unit('unit-wrapper', id) ) @@ -38,7 +31,6 @@ $ -> 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 @@ -51,6 +43,40 @@ $ -> $(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 @@ -58,7 +84,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 e9403dcffc..8478a98583 100644 --- a/cms/static/sass/_base.scss +++ b/cms/static/sass/_base.scss @@ -104,7 +104,12 @@ textarea { background: url('../img/drag-handle.png') no-repeat center; text-indent: -9999px; display: block; - float: right; + cursor: move; + height: 100%; + padding: 0; + @include position(absolute, 0px 0px 0 0); + width: 30px; + z-index: 99; } .editable { diff --git a/cms/static/sass/_calendar.scss b/cms/static/sass/_calendar.scss index d110a4cadf..53f31b449c 100644 --- a/cms/static/sass/_calendar.scss +++ b/cms/static/sass/_calendar.scss @@ -27,12 +27,17 @@ section.cal { @include inline-block; float: right; margin: 0; + padding: 0; + + &.actions { + float: left; + } li { @include inline-block; margin-right: 6px; border-right: 1px solid #ddd; - padding: 0 6px; + padding: 0 6px 0 0; &:last-child { border-right: 0; @@ -161,16 +166,10 @@ section.cal { &.draggable { background-color: $light-blue; - float: none; - height: 100%; - padding: 0; - @include position(absolute, 0px 0px 0 0); - width: 30px; - z-index: 99; opacity: .3; + padding: 0; &:hover { - cursor: move; background-color: lighten($yellow, 10%); } } diff --git a/cms/static/sass/_section.scss b/cms/static/sass/_section.scss index ca16a4093e..fa08e02901 100644 --- a/cms/static/sass/_section.scss +++ b/cms/static/sass/_section.scss @@ -109,6 +109,7 @@ section#unit-wrapper { li { padding: 6px; + position: relative; &:last-child { border-bottom: 0; @@ -124,7 +125,7 @@ section#unit-wrapper { a.draggable { float: right; - opacity: .5; + opacity: .4; } &.group { @@ -198,6 +199,7 @@ section#unit-wrapper { li { padding: 6px; border-collapse: collapse; + position: relative; &:last-child { border-bottom: 1px solid darken($light-blue, 8%); diff --git a/cms/templates/widgets/navigation.html b/cms/templates/widgets/navigation.html index 07a5747b09..69e2b005d0 100644 --- a/cms/templates/widgets/navigation.html +++ b/cms/templates/widgets/navigation.html @@ -1,7 +1,10 @@
- Timeline view - Multi-Module edit + +
  • Sort: