fix fc-ltr className not being cleaned up when calendar is destroyed

This commit is contained in:
Adam Shaw
2014-06-11 12:33:17 -07:00
parent 914b28a046
commit 3b4e8f6908
2 changed files with 28 additions and 1 deletions
+1 -1
View File
@@ -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');
}
+27
View File
@@ -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('');
});
});
});