CC-2436: Save pulldown settings

Fixing the issue of "show entries" dropdown setting not being saved.
After some investigation, it seems like we're destroying the calendar
everytime we modify the dropdown value, and create a new one,
which explains why the new setting is not being saved.

Fixed by moving the code that handles the updating to the place after
we create the new calendar. This makes the code cleaner as well.
This commit is contained in:
Yuchen Wang 2011-11-16 15:52:05 -05:00
parent a5939afd3f
commit a0bf7c90ba
3 changed files with 28 additions and 44 deletions

View file

@ -197,6 +197,10 @@ function viewDisplay( view ) {
.fullCalendar('destroy')
.fullCalendar(opt)
.fullCalendar( 'gotoDate', date );
//save slotMin value to db
var url = '/Schedule/set-time-interval/format/json';
$.post(url, {timeInterval: slotMin});
});
var topLeft = $(view.element).find("table.fc-agenda-days > thead th:first");
@ -214,6 +218,10 @@ function viewDisplay( view ) {
if(($("#add-show-form").length == 1) && ($("#add-show-form").css('display')=='none') && ($('.fc-header-left > span').length == 5)) {
makeAddShowButton();
}
//save view name to db
var url = '/Schedule/set-time-scale/format/json';
$.post(url, {timeScale: view.name});
}
function eventRender(event, element, view) {