diff --git a/docs/timeline/index.html b/docs/timeline/index.html index c7051a57..231654c4 100644 --- a/docs/timeline/index.html +++ b/docs/timeline/index.html @@ -916,7 +916,7 @@ function (option, path) {
false
dir="rtl"
. The timeline knows to take the nearest parent node direction and apply it. Notice that the timeline will prefer the option.rtl
over any parent dir="rtl"
An editable timeline allows to drag items around, create new items, and remove items. Changes are logged in the browser console.
+dir = "rtl"
in any parent nodeoptions.rtl = true
diff --git a/lib/timeline/Timeline.js b/lib/timeline/Timeline.js
index a2d528df..97eafd24 100644
--- a/lib/timeline/Timeline.js
+++ b/lib/timeline/Timeline.js
@@ -58,19 +58,16 @@ function Timeline (container, items, groups, options) {
};
this.options = util.deepExtend({}, this.defaultOptions);
+
+ // Create the DOM, props, and emitter
+ this._create(container);
+
if (!options || (options && typeof options.rtl == "undefined")) {
- if (container.dir) {
- this.options.rtl = container.dir == "rtl";
- } else if (document.dir) {
- this.options.rtl = document.dir == "rtl";
- }
+ this.options.rtl = window.getComputedStyle(this.dom.root, null).direction == "rtl";
} else {
this.options.rtl = options.rtl;
}
- // Create the DOM, props, and emitter
- this._create(container);
-
// all components listed here will be repainted automatically
this.components = [];