- Timestamp:
- 03/05/13 17:29:17 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/calendar/js/helpers.js
r7953 r7964 1891 1891 1892 1892 function getSelectedCalendars( reverse, type ){ 1893 var selector = ""; 1894 if(type == 0) 1895 selector = ".my-calendars"; 1896 if(type == 1) 1897 selector = ".my-groups-task"; 1898 var selecteds = {}; 1899 var cont = 0; 1900 jQuery(function() { 1901 jQuery(selector+" .calendar-view").each(function(i, obj) { 1902 var check_box = obj; 1903 if( reverse ? !check_box.checked : check_box.checked ) { 1904 selecteds[cont] = obj.value; 1905 cont++; 1906 }; 1907 }); 1893 var selector = !!type ? "div.my-groups-task .calendar-view" : "div.my-calendars .calendar-view, div.signed-calendars .calendar-view"; 1894 var returns = []; 1895 1896 $.each( $(selector), function(i , c){ 1897 1898 if( reverse ? !c.checked : c.checked ) 1899 returns.push( c.value ); 1900 1908 1901 }); 1909 if (!cont) 1910 return false; 1911 1912 selecteds.length = cont; 1913 return $.makeArray( selecteds );1902 1903 if (!returns.length) 1904 return false; 1905 1906 return returns; 1914 1907 } 1915 1908 … … 2286 2279 2287 2280 $('.calendar-view').click(function(evt){ 2288 if($tabs.tabs('option' ,'selected') != 0){ 2289 pageselectCallback('', 0, false, type);2290 } 2291 2292 if(Calendar.currentView){ 2293 var checkBox = $(this); 2294 if(!!Calendar.currentView[ checkBox.val() ]){ 2295 2296 $.each(Calendar.signatures , function(index, value) { 2297 2298 if(value.calendar.id == checkBox.val())2299 { 2300 value.hidden = checkBox.is(':checked') ? 0 : 1 ;2301 2302 DataLayer.put('calendarSignature', {id: ''+value.id , hidden: value.hidden });2303 DataLayer.commit();2304 }2305 2306 });2307 2308 Calendar.currentView[ checkBox.val() ].hidden = !checkBox.is(':checked'); 2309 $('#calendar').fullCalendar( 'refetchEvents' ); 2310 } 2311 2281 2282 var checkBox = $(this); 2283 var calendarId = $(this).val(); 2284 2285 Calendar.signatureOf[ calendarId ].hidden = (checkBox.is(':checked') ? 0 : 1 ); 2286 2287 DataLayer.put('calendarSignature', {id: Calendar.signatureOf[ calendarId ].id , hidden: Calendar.signatureOf[ calendarId ].hidden } ); 2288 DataLayer.commit(); 2289 2290 2291 if($tabs.tabs('option' ,'selected') == 0){ 2292 2293 if(Calendar.currentView && !!Calendar.currentView[ calendarId ]){ 2294 2295 Calendar.currentView[ calendarId ].hidden = !checkBox.is(':checked'); 2296 $('#calendar').fullCalendar( 'refetchEvents' ); 2297 } 2298 2299 }else{ 2300 type = $tabs.tabs('option' ,'selected'); 2301 type = type > 2 ? 2 : (type - 1) 2302 2303 pageselectCallback('', 0, false, type); 2304 } 2312 2305 }); 2313 2306 });
Note: See TracChangeset
for help on using the changeset viewer.