MDL-51819 themes: Nested navigation dropdowns work on small screens.

This commit is contained in:
Simeon Naydenov
2015-11-12 13:58:14 +08:00
committed by Adrian Greeve
parent 3f0687bcdf
commit c4277bcdd0
4 changed files with 22 additions and 5 deletions
File diff suppressed because one or more lines are too long
+7 -4
View File
@@ -679,15 +679,15 @@ define(['jquery'], function($) {
isActive = $parent.hasClass('open')
clearMenus()
clearMenus($this)
if (!isActive) {
if ('ontouchstart' in document.documentElement) {
// if mobile we we use a backdrop because click events don't delegate
$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
}
$parent.toggleClass('open')
}
$parent.toggleClass('open')
$this.focus()
@@ -737,10 +737,13 @@ define(['jquery'], function($) {
}
function clearMenus() {
function clearMenus($e) {
$('.dropdown-backdrop').remove()
$(toggle).each(function () {
getParent($(this)).removeClass('open')
var $parent = getParent($(this))
if ($e == undefined || $parent.find($e).length == 0) {
$parent.removeClass('open')
}
})
}
+7
View File
@@ -20,6 +20,13 @@ To update to the latest release of twitter bootstrap:
need to install recess (https://github.com/twitter/recess) to compile the .less files,
then run these commands in the bootstrapbase/less/ folder:
bootstrap.js
------------
Version: 2.3.0
An alteration was made to the JavaScript to allow nested navigation to work properly on small screens (MDL-51819).
Bootstap 3 does away with nested menus (https://github.com/twbs/bootstrap/pull/6342), So a completely different solution
may be required if we upgrade this further.
html5shiv.js
------------
+7
View File
@@ -14,4 +14,11 @@
<version>3.6.2</version>
<licenseversion>2.0</licenseversion>
</library>
<library>
<location>amd/src/bootstrap.js</location>
<name>bootstrap</name>
<license>Apache</license>
<version>2.3.2</version>
<licenseversion>2.0</licenseversion>
</library>
</libraries>