Răsfoiți Sursa

fix for dynamic lang option setting not change rtl classname

Adam Shaw 9 ani în urmă
părinte
comite
80d9f6ceee
1 a modificat fișierele cu 5 adăugiri și 2 ștergeri
  1. 5 2
      src/Calendar.js

+ 5 - 2
src/Calendar.js

@@ -541,13 +541,16 @@ function Calendar_constructor(element, overrides) {
 	function initialRender() {
 		element.addClass('fc');
 
-		t.bindOption('theme', function(theme) { // called immediately, and upon option change
+		// called immediately, and upon option change
+		t.bindOption('theme', function(theme) {
 			tm = theme ? 'ui' : 'fc'; // affects a larger scope
 			element.toggleClass('ui-widget', theme);
 			element.toggleClass('fc-unthemed', !theme);
 		});
 
-		t.bindOption('isRTL', function(isRTL) { // called immediately, and upon option change
+		// called immediately, and upon option change.
+		// HACK: lang often affects isRTL, so we explicitly listen to that too.
+		t.bindOptions([ 'isRTL', 'lang' ], function(isRTL) {
 			element.toggleClass('fc-ltr', !isRTL);
 			element.toggleClass('fc-rtl', isRTL);
 		});