Commit dbcad03d by Kyle Fiedler

Added some fixes for some small things adn reset the js

parent c8da9874
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()
......@@ -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 {
......
......@@ -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%);
}
}
......
......@@ -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%);
......
<section class="cal">
<header class="wip">
<a href="#">Timeline view</a>
<a href="#">Multi-Module edit</a>
<ul class="actions">
<li><a href="#">Timeline view</a></li>
<li><a href="#">Multi-Module edit</a></li>
</ul>
<ul>
<li>
<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