diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-07-09 18:13:41 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-07-10 12:03:00 +0100 |
commit | ac71675d3096ac9317ea230a408d69029bdadc73 (patch) | |
tree | 25ac9376545ed94915f38cd05c4ec5d0b6af2e42 /app/assets/javascripts/notes/stores/actions.js | |
parent | cb6bc902ed1f89e7f94caa86b75e756b9163af51 (diff) | |
download | gitlab-ce-ac71675d3096ac9317ea230a408d69029bdadc73.tar.gz |
Fixes toggle discussion button not expanding collapsed discussions
Discussions were being toggled by jquery DOM querying them and toggling
visibility but in vue, only the open discussions will be in the DOM
Fix includes:
- Adds a getter to the store to get the expanded discussions
- Adds an action to collapse a discussion
- When the user clicks the button, all data needed is now accessible
through a getter and we can dispatch an action to toggle the discussion
within the state, instead of showing/hiding with jQuery
- Removes hardcoded properties
Resolves #48237
Diffstat (limited to 'app/assets/javascripts/notes/stores/actions.js')
-rw-r--r-- | app/assets/javascripts/notes/stores/actions.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js index b2bf86eea56..3eefbe11c37 100644 --- a/app/assets/javascripts/notes/stores/actions.js +++ b/app/assets/javascripts/notes/stores/actions.js @@ -15,6 +15,8 @@ let eTagPoll; export const expandDiscussion = ({ commit }, data) => commit(types.EXPAND_DISCUSSION, data); +export const collapseDiscussion = ({ commit }, data) => commit(types.COLLAPSE_DISCUSSION, data); + export const setNotesData = ({ commit }, data) => commit(types.SET_NOTES_DATA, data); export const setNoteableData = ({ commit }, data) => commit(types.SET_NOTEABLE_DATA, data); |