Skip to content

Commit

Permalink
Add javascript exports (beta 13)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkwinkelmann committed Dec 1, 2020
1 parent e4011d2 commit ddc51f4
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion js/dist/admin.js

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

4 changes: 2 additions & 2 deletions js/dist/forum.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/src/forum/components/DiscussionPoll.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import LogInModal from 'flarum/components/LogInModal';

import ListVotersModal from './ListVotersModal';

export default class PollVote extends Component {
export default class DiscussionPoll extends Component {
init() {
this.poll = this.props.poll;

Expand Down
2 changes: 1 addition & 1 deletion js/src/forum/components/ListVotersModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Modal from 'flarum/components/Modal';
import avatar from 'flarum/helpers/avatar';
import username from 'flarum/helpers/username';

export default class ShowVotersModal extends Modal {
export default class ListVotersModal extends Modal {
className() {
return 'Modal--small';
}
Expand Down
11 changes: 11 additions & 0 deletions js/src/forum/components/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import CreatePollModal from './CreatePollModal';
import DiscussionPoll from './DiscussionPoll';
import EditPollModal from './EditPollModal';
import ListVotersModal from './ListVotersModal';

export const components = {
CreatePollModal,
DiscussionPoll,
EditPollModal,
ListVotersModal,
};
5 changes: 3 additions & 2 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { extend } from 'flarum/extend';
import Model from 'flarum/Model';
import CommentPost from 'flarum/components/CommentPost';

import Poll from './models/Poll';
import PollOption from './models/PollOption';
Expand All @@ -11,6 +9,9 @@ import addDiscussionComposerItem from './addDiscussionComposerItem';
import addPollToDiscussion from './addPollToDiscussion';
import addDiscussionControls from './addDiscussionControls';

export * from './components';
export * from './models';

app.initializers.add('fof/polls', () => {
app.store.models.polls = Poll;
app.store.models.poll_options = PollOption;
Expand Down
9 changes: 9 additions & 0 deletions js/src/forum/models/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Poll from './Poll';
import PollOption from './PollOption';
import PollVote from './PollVote';

export const models = {
Poll,
PollOption,
PollVote,
};

0 comments on commit ddc51f4

Please sign in to comment.