Skip to content
Snippets Groups Projects
Commit c70170cb authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2175637 by Wim Leers: Touch support for the toolbar: greatly improves...

Issue #2175637 by Wim Leers: Touch support for the toolbar: greatly improves the UX of Toolbar on mobile devices.
parent 3d938a36
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
/**
* @file
* A Backbone view for the toolbar element.
* A Backbone view for the toolbar element. Listens to mouse & touch.
*/
(function ($, Drupal, drupalSettings, Backbone) {
......@@ -8,13 +8,23 @@
"use strict";
/**
* Backbone view for the toolbar element.
* Backbone view for the toolbar element. Listens to mouse & touch.
*/
Drupal.toolbar.ToolbarVisualView = Backbone.View.extend({
events: {
'click .toolbar-bar .toolbar-tab': 'onTabClick',
'click .toolbar-toggle-orientation button': 'onOrientationToggleClick'
events: function () {
// Prevents delay and simulated mouse events.
var touchEndToClick = function (event) {
event.preventDefault();
event.target.click();
};
return {
'click .toolbar-bar .toolbar-tab': 'onTabClick',
'click .toolbar-toggle-orientation button': 'onOrientationToggleClick',
'touchend .toolbar-bar .toolbar-tab': touchEndToClick,
'touchend .toolbar-toggle-orientation button': touchEndToClick
};
},
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment