mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-06-27 16:10:13 +08:00
fix fc-ltr className not being cleaned up when calendar is destroyed
This commit is contained in:
+1
-1
@@ -345,7 +345,7 @@ function Calendar(element, instanceOptions) {
|
||||
|
||||
header.destroy();
|
||||
content.remove();
|
||||
element.removeClass('fc fc-rtl ui-widget');
|
||||
element.removeClass('fc fc-ltr fc-rtl ui-widget');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
describe('destroy', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
affix('#cal');
|
||||
});
|
||||
|
||||
describe('when calendar is LTR', function() {
|
||||
it('cleans up all classNames on the root element', function() {
|
||||
$('#cal').fullCalendar({
|
||||
isRTL: false
|
||||
});
|
||||
$('#cal').fullCalendar('destroy');
|
||||
expect($('#cal')[0].className).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('when calendar is RTL', function() {
|
||||
it('cleans up all classNames on the root element', function() {
|
||||
$('#cal').fullCalendar({
|
||||
isRTL: true
|
||||
});
|
||||
$('#cal').fullCalendar('destroy');
|
||||
expect($('#cal')[0].className).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user