MDL-60374 calendar: Add transition on event show/hide in monthly view

This commit is contained in:
Andrew Nicols 2017-10-09 11:46:50 +08:00
parent d8e9a23c48
commit 5873e1d234

View File

@ -140,10 +140,26 @@ require([
M.util.js_pending("month-detailed-{{uniqid}}-filterChanged"); M.util.js_pending("month-detailed-{{uniqid}}-filterChanged");
// A filter value has been changed. // A filter value has been changed.
// Find all matching cells in the popover data, and hide them. // Find all matching cells in the popover data, and hide them.
$("#month-detailed-{{uniqid}}") var target = $("#month-detailed-{{uniqid}}").find(CalendarSelectors.eventType[data.type]);
.find(CalendarSelectors.eventType[data.type])
.toggleClass('hidden', !!data.hidden); var transitionPromise = $.Deferred();
M.util.js_complete("month-detailed-{{uniqid}}-filterChanged"); if (data.hidden) {
transitionPromise.then(function() {
return target.slideUp('fast').promise();
});
} else {
transitionPromise.then(function() {
return target.slideDown('fast').promise();
});
}
transitionPromise.then(function() {
M.util.js_complete("month-detailed-{{uniqid}}-filterChanged");
return;
});
transitionPromise.resolve();
}); });
}); });
{{/js}} {{/js}}