Skip to content

Commit

Permalink
Merge pull request #11719 from rtibbles/double_click_blocking
Browse files Browse the repository at this point in the history
Removes inconsistently applied and mostly no-op double click blocking.
  • Loading branch information
marcellamaki authored Feb 27, 2024
2 parents 51a7503 + 4d442d6 commit 91f0b3e
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 45 deletions.
16 changes: 0 additions & 16 deletions kolibri/core/assets/src/state/modules/core/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,6 @@ export function handleApiError(store, { error, reloadOnReconnect = false } = {})
throw error;
}

/**
* Used to prevent inadvertent actions if a user double-clicks to navigate
*
* Something of a hack. A better strategy would be to create a new
* `setLoading` action which handles both `state.core.loading` and
* `state.core.blockDoubleClicks` with a single function.
*/
export function blockDoubleClicks(store) {
if (!store.state.blockDoubleClicks) {
store.commit('CORE_BLOCK_CLICKS', true);
setTimeout(() => {
store.commit('CORE_BLOCK_CLICKS', false);
}, 500);
}
}

export function setSession(store, { session, clientNow }) {
const serverTime = session.server_time;
if (clientNow) {
Expand Down
1 change: 0 additions & 1 deletion kolibri/core/assets/src/state/modules/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default {
state() {
return {
error: '',
blockDoubleClicks: false,
loading: true,
pageSessionId: 0,
totalProgress: null,
Expand Down
3 changes: 0 additions & 3 deletions kolibri/core/assets/src/state/modules/core/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export default {
CORE_SET_ERROR(state, error) {
state.error = error;
},
CORE_BLOCK_CLICKS(state, blocked) {
state.blockDoubleClicks = blocked;
},
SET_TOTAL_PROGRESS(state, progress) {
state.totalProgress = progress;
},
Expand Down
1 change: 0 additions & 1 deletion kolibri/plugins/learn/assets/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class LearnModule extends KolibriApp {

// after every navigation, block double-clicks
router.afterEach((toRoute, fromRoute) => {
this.store.dispatch('blockDoubleClicks');
this.store.dispatch('resetModuleState', { toRoute, fromRoute });
});
super.ready();
Expand Down
12 changes: 0 additions & 12 deletions kolibri/plugins/learn/assets/src/views/TopicsContentPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
class="main-wrapper"
>

<div v-if="blockDoubleClicks" class="click-mask"></div>

<SkipNavigationLink />
<LearningActivityBar
ref="activityBar"
Expand Down Expand Up @@ -381,7 +379,6 @@
computed: {
...mapState({
error: state => state.core.error,
blockDoubleClicks: state => state.core.blockDoubleClicks,
}),
isCoachContent() {
return this.content && this.content.coach_content ? 1 : 0;
Expand Down Expand Up @@ -735,15 +732,6 @@
outline-style: none !important;
}
.click-mask {
position: fixed;
top: 0;
left: 0;
z-index: 24;
width: 100%;
height: 100%;
}
.loader {
position: fixed;
right: 0;
Expand Down
12 changes: 0 additions & 12 deletions kolibri/plugins/user_auth/assets/src/views/UserAuthLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
:style="mainWrapperStyles"
>

<div v-if="blockDoubleClicks" class="click-mask"></div>

<div
v-if="!loading"
class="scrolling-pane"
Expand Down Expand Up @@ -89,7 +87,6 @@
...mapState({
error: state => state.core.error,
loading: state => state.core.loading,
blockDoubleClicks: state => state.core.blockDoubleClicks,
}),
isAuthorized() {
return !(
Expand Down Expand Up @@ -168,15 +165,6 @@
overflow-x: auto;
}
.click-mask {
position: fixed;
top: 0;
left: 0;
z-index: 24;
width: 100%;
height: 100%;
}
.debug {
font-family: monospace;
font-size: large;
Expand Down

0 comments on commit 91f0b3e

Please sign in to comment.