mirror of
https://github.com/flarum/framework.git
synced 2024-11-28 20:16:08 +08:00
Fix mobile controls gesture on discussion deletion/restoration (#2324)
Because the Slidable class was always added on creation, it was lost every time the class list changed (in this case when the discussion was hidden/unhidden which added/removed DiscussionListItem--hidden class). So by determining the Slidable class's presence in elementAttrs() method, it guarantees it always properly set.
This commit is contained in:
parent
d6511e0df5
commit
6668e75019
|
@ -50,6 +50,7 @@ export default class DiscussionListItem extends Component {
|
|||
'DiscussionListItem',
|
||||
this.active() ? 'active' : '',
|
||||
this.attrs.discussion.isHidden() ? 'DiscussionListItem--hidden' : '',
|
||||
'ontouchstart' in window ? 'Slidable' : '',
|
||||
]),
|
||||
};
|
||||
}
|
||||
|
@ -136,7 +137,7 @@ export default class DiscussionListItem extends Component {
|
|||
// This allows the user to drag the row to either side of the screen to
|
||||
// reveal controls.
|
||||
if ('ontouchstart' in window) {
|
||||
const slidableInstance = slidable(this.$().addClass('Slidable'));
|
||||
const slidableInstance = slidable(this.$());
|
||||
|
||||
this.$('.DiscussionListItem-controls').on('hidden.bs.dropdown', () => slidableInstance.reset());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user