Skip to content

Commit

Permalink
Add custom-elements pollyfill & markdown bar if Reflect API is present
Browse files Browse the repository at this point in the history
Ref #1702
  • Loading branch information
dsevillamartin committed Apr 10, 2019
1 parent c967aab commit e762293
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 0 additions & 5 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"@github/markdown-toolbar-element": "^0.1.1",
"@webcomponents/custom-elements": "^1.2.1",
"flarum-webpack-config": "0.1.0-beta.10",
"harmony-reflect": "^1.6.1",
"mdarea": "^0.0.10",
"webpack": "^4.26.0",
"webpack-cli": "^3.1.2"
Expand Down
13 changes: 9 additions & 4 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@ import { extend } from 'flarum/extend';
import TextEditor from 'flarum/components/TextEditor';
import icon from 'flarum/helpers/icon';

import '@webcomponents/custom-elements';
import 'harmony-reflect';
import '@github/markdown-toolbar-element';
import MarkdownArea from 'mdarea/mdarea.js';
let MarkdownArea;

if (window.Reflect) {
require('@webcomponents/custom-elements');
require('@github/markdown-toolbar-element');
MarkdownArea = require('mdarea/mdarea.js');
}

app.initializers.add('flarum-markdown', function(app) {
if (!MarkdownArea) return;

let index = 1;

extend(TextEditor.prototype, 'init', function() {
Expand Down

0 comments on commit e762293

Please sign in to comment.