diff --git a/js/admin/Gulpfile.js b/js/admin/Gulpfile.js index 51da8cfb4..03ad98821 100644 --- a/js/admin/Gulpfile.js +++ b/js/admin/Gulpfile.js @@ -10,6 +10,7 @@ gulp({ bowerDir + '/es6-micro-loader/dist/system-polyfill.js', bowerDir + '/mithril/mithril.js', + bowerDir + '/m.attrs.bidi/bidi.js', bowerDir + '/jquery/dist/jquery.js', bowerDir + '/moment/moment.js', diff --git a/js/bower.json b/js/bower.json index f80cf6d8e..e6ba467d4 100644 --- a/js/bower.json +++ b/js/bower.json @@ -10,6 +10,7 @@ "mithril": "lhorie/mithril.js#next", "es6-micro-loader": "caridy/es6-micro-loader#v0.2.1", "fastclick": "~1.0.6", - "autolink": "*" + "autolink": "*", + "m.attrs.bidi": "tobscure/m.attrs.bidi" } } diff --git a/js/forum/Gulpfile.js b/js/forum/Gulpfile.js index eeb37cd96..40ea4ef63 100644 --- a/js/forum/Gulpfile.js +++ b/js/forum/Gulpfile.js @@ -10,6 +10,7 @@ gulp({ bowerDir + '/es6-micro-loader/dist/system-polyfill.js', bowerDir + '/mithril/mithril.js', + bowerDir + '/m.attrs.bidi/bidi.js', bowerDir + '/jquery/dist/jquery.js', bowerDir + '/jquery.hotkeys/jquery.hotkeys.js', bowerDir + '/color-thief/js/color-thief.js', diff --git a/js/lib/utils/patchMithril.js b/js/lib/utils/patchMithril.js index a86480699..9ca27e1a9 100644 --- a/js/lib/utils/patchMithril.js +++ b/js/lib/utils/patchMithril.js @@ -8,8 +8,14 @@ export default function patchMithril(global) { return comp.component(...args); } - return mo.apply(this, arguments); - } + const node = mo.apply(this, arguments); + + if (node.attrs.bidi) { + m.bidi(node, node.attrs.bidi); + } + + return node; + }; Object.keys(mo).forEach(key => m[key] = mo[key]);