{ this.scope.html( response ); $( document ).trigger( 'contentChange', [ this.scope ] ); }) .always(() => { this._setLoading( false ); }); }, /** * Toggles the loading state on the view * * @param {boolean} state Enable the loading state? * @returns {void} */ _setLoading(state) { if( state ){ this.scope.animate( { opacity: "0.6" }, 'fast' ); } else { this.scope.animate( { opacity: "1" }, 'fast' ); } } }); }(jQuery, _));]]> ", initialize: function () { this.setup(); }, /** * Setup method * * @returns {void} */ setup: function () { this._alignEvents(); }, _alignEvents: function () { // Lets start by getting all active days in the current calendar var days = this.scope.find('.cCalendar_date'); var currentPositions = []; var self = this; _.each( days, function (day) { var day = $( day ); var dayNumber = day.find('.cCalendar_dayNumber').text(); var weekStart = false; if( day.closest('td').is('tr > td:first-child') ){ weekStart = true; } // Get events for this day var events = day.find('.cEvents_ranged [data-eventID]'); // If there's no events, we can skip this day if( !events.length ){ currentPositions = []; return; } // Build a wrapper into which we'll move our events var wrapper = $("