Commit dbcad03d by Kyle Fiedler

Added some fixes for some small things adn reset the js

parent c8da9874
class @CMS class @CMS
@setHeight = => @setHeight = =>
windowHeight = $(window).height() windowHeight = $(this).height()
headerHeight = $('body > header').outerHeight() @contentHeight = windowHeight - 29
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 = => @bind = =>
$('a.module-edit').click -> $('a.module-edit').click ->
...@@ -19,9 +13,8 @@ class @CMS ...@@ -19,9 +13,8 @@ class @CMS
$.get('/edit_item', {id: id}, (data) => $.get('/edit_item', {id: id}, (data) =>
$('#module-html').empty().append(data) $('#module-html').empty().append(data)
CMS.bind() CMS.bind()
CMS.setHeight() $('body.content .cal').css('height', @contentHeight)
$('body').addClass('content') $('body').addClass('content')
$('body.content .cal ol > li').css('height','auto')
$('section.edit-pane').show() $('section.edit-pane').show()
new Unit('unit-wrapper', id) new Unit('unit-wrapper', id)
) )
...@@ -38,7 +31,6 @@ $ -> ...@@ -38,7 +31,6 @@ $ ->
heighest = if $(this).height() > heighest then $(this).height() else heighest heighest = if $(this).height() > heighest then $(this).height() else heighest
$('.cal ol > li').css('height',heighest + 'px') $('.cal ol > li').css('height',heighest + 'px')
$('body.content .cal ol > li').css('height','auto')
$('.add-new-section').click -> return false $('.add-new-section').click -> return false
...@@ -51,6 +43,40 @@ $ -> ...@@ -51,6 +43,40 @@ $ ->
$(this).parent().parent().hide() $(this).parent().parent().hide()
return false 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 -> $('.video-new a').click ->
$('section.edit-pane').show() $('section.edit-pane').show()
return false return false
...@@ -58,7 +84,7 @@ $ -> ...@@ -58,7 +84,7 @@ $ ->
$('.problem-new a').click -> $('.problem-new a').click ->
$('section.edit-pane').show() $('section.edit-pane').show()
return false return false
CMS.setHeight() CMS.setHeight()
CMS.bind() CMS.bind()
...@@ -104,7 +104,12 @@ textarea { ...@@ -104,7 +104,12 @@ textarea {
background: url('../img/drag-handle.png') no-repeat center; background: url('../img/drag-handle.png') no-repeat center;
text-indent: -9999px; text-indent: -9999px;
display: block; display: block;
float: right; cursor: move;
height: 100%;
padding: 0;
@include position(absolute, 0px 0px 0 0);
width: 30px;
z-index: 99;
} }
.editable { .editable {
......
...@@ -27,12 +27,17 @@ section.cal { ...@@ -27,12 +27,17 @@ section.cal {
@include inline-block; @include inline-block;
float: right; float: right;
margin: 0; margin: 0;
padding: 0;
&.actions {
float: left;
}
li { li {
@include inline-block; @include inline-block;
margin-right: 6px; margin-right: 6px;
border-right: 1px solid #ddd; border-right: 1px solid #ddd;
padding: 0 6px; padding: 0 6px 0 0;
&:last-child { &:last-child {
border-right: 0; border-right: 0;
...@@ -161,16 +166,10 @@ section.cal { ...@@ -161,16 +166,10 @@ section.cal {
&.draggable { &.draggable {
background-color: $light-blue; background-color: $light-blue;
float: none;
height: 100%;
padding: 0;
@include position(absolute, 0px 0px 0 0);
width: 30px;
z-index: 99;
opacity: .3; opacity: .3;
padding: 0;
&:hover { &:hover {
cursor: move;
background-color: lighten($yellow, 10%); background-color: lighten($yellow, 10%);
} }
} }
......
...@@ -109,6 +109,7 @@ section#unit-wrapper { ...@@ -109,6 +109,7 @@ section#unit-wrapper {
li { li {
padding: 6px; padding: 6px;
position: relative;
&:last-child { &:last-child {
border-bottom: 0; border-bottom: 0;
...@@ -124,7 +125,7 @@ section#unit-wrapper { ...@@ -124,7 +125,7 @@ section#unit-wrapper {
a.draggable { a.draggable {
float: right; float: right;
opacity: .5; opacity: .4;
} }
&.group { &.group {
...@@ -198,6 +199,7 @@ section#unit-wrapper { ...@@ -198,6 +199,7 @@ section#unit-wrapper {
li { li {
padding: 6px; padding: 6px;
border-collapse: collapse; border-collapse: collapse;
position: relative;
&:last-child { &:last-child {
border-bottom: 1px solid darken($light-blue, 8%); border-bottom: 1px solid darken($light-blue, 8%);
......
<section class="cal"> <section class="cal">
<header class="wip"> <header class="wip">
<a href="#">Timeline view</a> <ul class="actions">
<a href="#">Multi-Module edit</a> <li><a href="#">Timeline view</a></li>
<li><a href="#">Multi-Module edit</a></li>
</ul>
<ul> <ul>
<li> <li>
<h2>Sort:</h2> <h2>Sort:</h2>
......
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