Skip to content

Instantly share code, notes, and snippets.

@ohmydevops
Created January 22, 2019 17:12
Show Gist options
  • Save ohmydevops/2c7674d0baef1a95b89e6ba763766ec6 to your computer and use it in GitHub Desktop.
Save ohmydevops/2c7674d0baef1a95b89e6ba763766ec6 to your computer and use it in GitHub Desktop.
handel back button
$(window).on('previous', function (e) {
e.preventDefault();
var stop = false;
var width = document.getElementById("mySidenav").style.width;
$('.modal').each(function () {
if ($(this).hasClass('show')) {
$(this).modal('hide');
stop = true;
}
}).promise().done(function () {
if (stop) {
stop = false;
console.log("بلاه بلاه بلاه");
} else {
if (width == "250px") {
document.getElementById("mySidenav").style.width = "0";
} else {
$('.warantybottom').each(function () {
if ($(this).hasClass('show')) {
$(this).collapse('toggle');
}
});
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment