Disable tooltips on mobile, as they add an extra click that isn't really useful and is highly annoying

This commit is contained in:
Joseph Schorr 2015-04-21 14:56:48 -04:00
parent 0cb05436f7
commit dfc2b562e7

View file

@ -49,6 +49,20 @@ quayApp = angular.module('quay', quayDependencies, function($provide, cfpLoading
cfpLoadingBarProvider.includeSpinner = false;
});
// Disable tooltips on touch devices.
quayApp.config(['$tooltipProvider', function ($tooltipProvider) {
var tooltipFactory = $tooltipProvider.$get[$tooltipProvider.$get.length - 1];
// decorate the tooltip getter
$tooltipProvider.$get[$tooltipProvider.$get.length - 1] = function($window) {
if ('ontouchstart' in $window) {
return function() {};
}
return tooltipFactory.apply(this, arguments);
};
}]);
// Configure the routes.
quayApp.config(['$routeProvider', '$locationProvider', 'pages', function($routeProvider, $locationProvider, pages) {
var title = window.__config['REGISTRY_TITLE'] || 'Quay.io';