mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 21:21:15 -07:00
Fix settings hover nav menu for mobile
This commit is contained in:
parent
9fcd0da83d
commit
24205dc86e
6 changed files with 29 additions and 25 deletions
|
@ -210,8 +210,8 @@ from plexpy.helpers import anon_url
|
||||||
% else:
|
% else:
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
% endif
|
% endif
|
||||||
<a href="settings" class="dropdown-toggle disabled" aria-haspopup="true" data-toggle="dropdown" data-hover="dropdown"><i class="fa fa-lg fa-cogs"></i> <span class="caret"></span></a>
|
<a href="#" class="dropdown-toggle" aria-haspopup="true" data-toggle="dropdown" data-hover="dropdown" data-href="settings"><i class="fa fa-lg fa-cogs"></i> <span class="caret"></span></a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu" id="settings-dropdown-menu">
|
||||||
<li><a href="settings"><i class="fa fa-cogs"></i> Settings</a></li>
|
<li><a href="settings"><i class="fa fa-cogs"></i> Settings</a></li>
|
||||||
<li role="separator" class="divider"></li>
|
<li role="separator" class="divider"></li>
|
||||||
<li><a href="logs"><i class="fa fa-list-alt"></i> View Logs</a></li>
|
<li><a href="logs"><i class="fa fa-list-alt"></i> View Logs</a></li>
|
||||||
|
@ -238,7 +238,8 @@ ${next.headerIncludes()}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="${http_root}js/jquery-2.1.4.min.js"></script>
|
<script src="${http_root}js/jquery-2.1.4.min.js"></script>
|
||||||
<script src="${http_root}js/bootstrap3/bootstrap.min.js"></script>
|
<script src="${http_root}js/bootstrap.min.js"></script>
|
||||||
|
<script src="${http_root}js/bootstrap-hover-dropdown.min.js"></script>
|
||||||
<script src="${http_root}js/script.js"></script>
|
<script src="${http_root}js/script.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$('#updateDismiss').click(function() {
|
$('#updateDismiss').click(function() {
|
||||||
|
@ -269,8 +270,12 @@ ${next.headerIncludes()}
|
||||||
window.location.href = "checkGithub";
|
window.location.href = "checkGithub";
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
$('.dropdown-toggle').click(function (e) {
|
||||||
<script>
|
if (!(('ontouchstart' in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0))) {
|
||||||
|
window.location.href = $(this).data('href');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#search_form').submit(function (e) {
|
$('#search_form').submit(function (e) {
|
||||||
if ($('#query').hasClass('active') && $('#query').val().trim() != '') {
|
if ($('#query').hasClass('active') && $('#query').val().trim() != '') {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -291,8 +296,7 @@ ${next.headerIncludes()}
|
||||||
}).removeClass('active');
|
}).removeClass('active');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
// Work around for iOS web app links opening in Safari
|
// Work around for iOS web app links opening in Safari
|
||||||
if (("standalone" in window.navigator) && window.navigator.standalone) {
|
if (("standalone" in window.navigator) && window.navigator.standalone) {
|
||||||
|
@ -305,17 +309,6 @@ ${next.headerIncludes()}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack alert: if we don't have a touchscreen, and we are already hovering the mouse, then click should link instead of toggle
|
|
||||||
if ((navigator.maxTouchPoints || 0) < 2) {
|
|
||||||
$('.dropdown-toggle').on('click', function () {
|
|
||||||
var $this = $(this);
|
|
||||||
if ($this.attr('aria-expanded') === 'true') {
|
|
||||||
window.location.href = $this.attr('href');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
${next.javascriptIncludes()}
|
${next.javascriptIncludes()}
|
||||||
|
@ -324,4 +317,4 @@ ${next.javascriptIncludes()}
|
||||||
|
|
||||||
<%def name="javascriptIncludes()"></%def>
|
<%def name="javascriptIncludes()"></%def>
|
||||||
<%def name="headIncludes()"></%def>
|
<%def name="headIncludes()"></%def>
|
||||||
<%def name="headerIncludes()"></%def>
|
<%def name="headerIncludes()"></%def>
|
|
@ -99,10 +99,9 @@ img {
|
||||||
.navbar-toggle:focus {
|
.navbar-toggle:focus {
|
||||||
background-color: #2f2f2f;
|
background-color: #2f2f2f;
|
||||||
}
|
}
|
||||||
@media screen and (min-width: 768px) {
|
.nav .open > a, .nav .open > a:hover, .nav .open > a:focus {
|
||||||
.dropdown:hover > .dropdown-menu {
|
background-color: #2f2f2f;
|
||||||
display: block;
|
border-color: none;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.dropdown-menu {
|
.dropdown-menu {
|
||||||
background-color: #282828;
|
background-color: #282828;
|
||||||
|
|
12
data/interfaces/default/js/bootstrap-hover-dropdown.min.js
vendored
Normal file
12
data/interfaces/default/js/bootstrap-hover-dropdown.min.js
vendored
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
/**
|
||||||
|
* @preserve
|
||||||
|
* Project: Bootstrap Hover Dropdown
|
||||||
|
* Author: Cameron Spear
|
||||||
|
* Version: v2.2.1
|
||||||
|
* Contributors: Mattia Larentis
|
||||||
|
* Dependencies: Bootstrap's Dropdown plugin, jQuery
|
||||||
|
* Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience.
|
||||||
|
* License: MIT
|
||||||
|
* Homepage: http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/
|
||||||
|
*/
|
||||||
|
!function(e,n,o){var t=e();e.fn.dropdownHover=function(o){return"ontouchstart"in document?this:(t=t.add(this.parent()),this.each(function(){function r(e){d.parents(".navbar").find(".navbar-toggle").is(":visible")||(n.clearTimeout(a),n.clearTimeout(i),i=n.setTimeout(function(){t.find(":focus").blur(),f.instantlyCloseOthers===!0&&t.removeClass("open"),n.clearTimeout(i),d.attr("aria-expanded","true"),s.addClass("open"),d.trigger(l)},f.hoverDelay))}var a,i,d=e(this),s=d.parent(),u={delay:500,hoverDelay:0,instantlyCloseOthers:!0},h={delay:e(this).data("delay"),hoverDelay:e(this).data("hover-delay"),instantlyCloseOthers:e(this).data("close-others")},l="show.bs.dropdown",c="hide.bs.dropdown",f=e.extend(!0,{},u,o,h);s.hover(function(e){return s.hasClass("open")||d.is(e.target)?void r(e):!0},function(){n.clearTimeout(i),a=n.setTimeout(function(){d.attr("aria-expanded","false"),s.removeClass("open"),d.trigger(c)},f.delay)}),d.hover(function(e){return s.hasClass("open")||s.is(e.target)?void r(e):!0}),s.find(".dropdown-submenu").each(function(){var o,t=e(this);t.hover(function(){n.clearTimeout(o),t.children(".dropdown-menu").show(),t.siblings().children(".dropdown-menu").hide()},function(){var e=t.children(".dropdown-menu");o=n.setTimeout(function(){e.hide()},f.delay)})})}))},e(document).ready(function(){e(n).width()>769&&e(".navbar .dropdown > a").click(function(){location.href=this.href})}),e(document).ready(function(){e('[data-hover="dropdown"]').dropdownHover()})}(jQuery,window);
|
|
@ -192,7 +192,7 @@ from plexpy import common
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="${http_root}js/jquery-2.1.4.min.js"></script>
|
<script src="${http_root}js/jquery-2.1.4.min.js"></script>
|
||||||
<script src="${http_root}js/bootstrap3/bootstrap.min.js"></script>
|
<script src="${http_root}js/bootstrap.min.js"></script>
|
||||||
<script src="${http_root}js/selectize.min.js"></script>
|
<script src="${http_root}js/selectize.min.js"></script>
|
||||||
<script src="${http_root}js/script.js"></script>
|
<script src="${http_root}js/script.js"></script>
|
||||||
<script src="${http_root}js/bootstrap-wizard.min.js"></script>
|
<script src="${http_root}js/bootstrap-wizard.min.js"></script>
|
||||||
|
|
|
@ -617,4 +617,4 @@ class Config(object):
|
||||||
home_sections = self.HOME_SECTIONS
|
home_sections = self.HOME_SECTIONS
|
||||||
home_sections.remove('library_stats')
|
home_sections.remove('library_stats')
|
||||||
self.HOME_SECTIONS = home_sections
|
self.HOME_SECTIONS = home_sections
|
||||||
self.CONFIG_VERSION = '4'
|
self.CONFIG_VERSION = '5'
|
Loading…
Add table
Add a link
Reference in a new issue