Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions www/core/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,12 @@ angular.module('mm.core', ['pascalprecht.translate'])
}
});

if (!$mmApp.isDevice()) {
// Re-define getParentOrSelfWithClass to change the default value of the depth param.
// This is to allow scrolling with trackpad when hovering deep elements.
var originalFunction = ionic.DomUtil.getParentOrSelfWithClass;
ionic.DomUtil.getParentOrSelfWithClass = function(e, className, depth) {
// In desktop, re-define getParentOrSelfWithClass to allow scrolling with trackpad when hovering deep elements.
// In iOS, re-define getParentWithClass to prevent the keyboard to hide deep input elements.
var fnName = !$mmApp.isDevice() ? 'getParentOrSelfWithClass' : (ionic.Platform.isIOS() ? 'getParentWithClass' : '');
if (fnName) {
var originalFunction = ionic.DomUtil[fnName];
ionic.DomUtil[fnName] = function(e, className, depth) {
depth = depth || 20;
return originalFunction(e, className, depth);
};
Expand Down