Skip to content

Commit

Permalink
make mobile menu close able after opening
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhuang committed May 14, 2013
1 parent 55f1a7c commit a3edfe4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion deme_django/static/javascripts/deme/adminbar-ck.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 16 additions & 12 deletions deme_django/static/javascripts/deme/adminbar.js
Expand Up @@ -34,19 +34,23 @@ $(function(){
function hideAdminbarIfMobile(elem) {
if(checker.iphone || checker.ipad) {
setAdminbar(false);
setTimeout(function(){
// we are swtiching dom structurs so we need to find out what dropdown to show on the new navbar
var classes = $(elem).closest('.dropdown').attr('class').split(' ');
var classSelector = '';
var ignoreList = ['open'];
for (var i = 0; i < classes.length; i++) {
var testClass = classes[i];
if ($.inArray(testClass, ignoreList) === -1) {
classSelector += '.' + testClass;
if ($(elem).closest('.dropdown').hasClass('open')) {

} else {
setTimeout(function(){
// we are swtiching dom structurs so we need to find out what dropdown to show on the new navbar
var classes = $(elem).closest('.dropdown').attr('class').split(' ');
var classSelector = '';
var ignoreList = ['open'];
for (var i = 0; i < classes.length; i++) {
var testClass = classes[i];
if ($.inArray(testClass, ignoreList) === -1) {
classSelector += '.' + testClass;
}
}
}
$(classSelector).addClass('open');
}, 1);
$(classSelector).addClass('open');
}, 1);
}
}
}

Expand Down

0 comments on commit a3edfe4

Please sign in to comment.