MDL-51819 themes: Nested navigation dropdowns work on small screens.
authorSimeon Naydenov <moniNaydenov@gmail.com>
Mon, 9 Nov 2015 05:13:10 +0000 (13:13 +0800)
committerAdrian Greeve <adrian@moodle.com>
Thu, 12 Nov 2015 05:53:18 +0000 (13:53 +0800)
theme/bootstrapbase/amd/build/bootstrap.min.js
theme/bootstrapbase/amd/src/bootstrap.js
theme/bootstrapbase/readme_moodle.txt
theme/bootstrapbase/thirdpartylibs.xml

index 26de8d8..86e0a2e 100644 (file)
Binary files a/theme/bootstrapbase/amd/build/bootstrap.min.js and b/theme/bootstrapbase/amd/build/bootstrap.min.js differ
index 196975e..35fb020 100644 (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')
+      }
     })
   }
 
index bc95e04..8b2fe0e 100644 (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
 ------------
index 8cb799f..8b4a011 100644 (file)
     <version>3.7.3</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>