found and fixed a bug in TopNav.collapseBar() while writing test for it

This commit is contained in:
El RIDO 2018-03-03 07:55:27 +01:00
parent ce6764e97d
commit 76debde85b
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
4 changed files with 50 additions and 7 deletions

View file

@ -2557,6 +2557,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) {
* Shows the QR code of the current paste (URL).
*
* @name TopNav.displayQrCode
* @private
* @function
*/
function displayQrCode()
@ -2736,12 +2737,9 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) {
*/
me.collapseBar = function()
{
var $bar = $('.navbar-toggle');
// check if bar is expanded
if ($bar.hasClass('collapse in')) {
if ($('#navbar').attr('aria-expanded')) {
// if so, toggle it
$bar.click();
$('.navbar-toggle').click();
}
};