diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-03-14 08:50:46 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-03-16 18:02:55 -0400 |
commit | 12896bd23eeba79884245c1c29fdc568cf21a7fa (patch) | |
tree | 4e7f83d3e2564b9b89d669e9f7905ff11768b11a /web/react/stores/modal_store.jsx | |
parent | 29fe6a3d13c9c7aa490fffebbe5d1b5fdf1e3090 (diff) | |
download | chat-12896bd23eeba79884245c1c29fdc568cf21a7fa.tar.gz chat-12896bd23eeba79884245c1c29fdc568cf21a7fa.tar.bz2 chat-12896bd23eeba79884245c1c29fdc568cf21a7fa.zip |
Converting to Webpack. Stage 1.
Diffstat (limited to 'web/react/stores/modal_store.jsx')
-rw-r--r-- | web/react/stores/modal_store.jsx | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/web/react/stores/modal_store.jsx b/web/react/stores/modal_store.jsx deleted file mode 100644 index 5ea38030b..000000000 --- a/web/react/stores/modal_store.jsx +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import AppDispatcher from '../dispatcher/app_dispatcher.jsx'; -import EventEmitter from 'events'; - -import Constants from '../utils/constants.jsx'; -const ActionTypes = Constants.ActionTypes; - -class ModalStoreClass extends EventEmitter { - constructor() { - super(); - - this.addModalListener = this.addModalListener.bind(this); - this.removeModalListener = this.removeModalListener.bind(this); - - this.handleEventPayload = this.handleEventPayload.bind(this); - this.dispatchToken = AppDispatcher.register(this.handleEventPayload); - } - - addModalListener(action, callback) { - this.on(action, callback); - } - - removeModalListener(action, callback) { - this.removeListener(action, callback); - } - - handleEventPayload(payload) { - // toggle event handlers should accept a boolean show/hide value and can accept a map of arguments - const {type, value, ...args} = payload.action; //eslint-disable-line no-use-before-define - - switch (type) { - case ActionTypes.TOGGLE_IMPORT_THEME_MODAL: - case ActionTypes.TOGGLE_INVITE_MEMBER_MODAL: - case ActionTypes.TOGGLE_DELETE_POST_MODAL: - case ActionTypes.TOGGLE_GET_POST_LINK_MODAL: - case ActionTypes.TOGGLE_GET_TEAM_INVITE_LINK_MODAL: - case ActionTypes.TOGGLE_REGISTER_APP_MODAL: - this.emit(type, value, args); - break; - } - } -} - -const ModalStore = new ModalStoreClass(); -export default ModalStore; |