only have add show button on full calendar when the add show form isn't displayed.

This commit is contained in:
Naomi 2011-02-10 11:28:56 -05:00
parent ac86fc50e8
commit b6c26a583b
2 changed files with 19 additions and 11 deletions

View File

@ -123,6 +123,9 @@ function setAddShowEvents() {
$("#schedule_calendar").width(y+z+50); $("#schedule_calendar").width(y+z+50);
$("#schedule_calendar").fullCalendar('render'); $("#schedule_calendar").fullCalendar('render');
$("#add-show-form").hide(); $("#add-show-form").hide();
//in full-calendar-functions.js
makeAddShowButton();
}); });
$("#add-show-submit") $("#add-show-submit")

View File

@ -4,6 +4,21 @@
* *
*/ */
function makeAddShowButton(){
$('.fc-header-left tbody tr:first')
.append('<td><span class="fc-header-space"></span></td>')
.append('<td><a href="#" class="add-button"><span class="add-icon"></span>Show</a></td>')
.find('td:last > a')
.click(function(){
$("#add-show-form").show();
var y = $("#schedule_calendar").width();
var z = $("#schedule-add-show").width();
$("#schedule_calendar").width(y-z-50);
$("#schedule_calendar").fullCalendar('render');
$(this).remove();
});
}
function makeTimeStamp(date){ function makeTimeStamp(date){
var sy, sm, sd, h, m, s, timestamp; var sy, sm, sd, h, m, s, timestamp;
sy = date.getFullYear(); sy = date.getFullYear();
@ -54,17 +69,7 @@ function viewDisplay( view ) {
} }
if($("#add-show-form").length == 1 && $('.fc-header-left tbody td').length === 5) { if($("#add-show-form").length == 1 && $('.fc-header-left tbody td').length === 5) {
$('.fc-header-left tbody tr:first') makeAddShowButton();
.append('<td><span class="fc-header-space"></span></td>')
.append('<td><a href="#" class="add-button"><span class="add-icon"></span>Show</a></td>')
.find('td:last > a')
.click(function(){
$("#add-show-form").show();
var y = $("#schedule_calendar").width();
var z = $("#schedule-add-show").width();
$("#schedule_calendar").width(y-z-50);
$("#schedule_calendar").fullCalendar('render');
});
} }
} }