Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #12 from psalaets/remove-zepto
Browse files Browse the repository at this point in the history
Remove zepto
  • Loading branch information
Gallen.Hu authored Jan 3, 2017
2 parents 76d59ac + 27aa167 commit 7de2f62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion layout/_partial/after-footer.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- scripts -->
<script src="//cdn.bootcss.com/zepto/1.2.0/zepto.min.js"></script>
<%- js('js/app.js') %>
<%if (config.disqus_shortname){ %>
<script>
Expand Down
20 changes: 12 additions & 8 deletions source/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ var appDaily = {
return false;
},
bindToggleButton: function() {
var $btn = $('.menu-toggle');
var $nav = $('.navbar');
var btn = document.querySelector('.menu-toggle');
var nav = document.querySelector('.navbar');

$btn.on('click', function() {
$nav.toggleClass('show-force');
})
btn.addEventListener('click', function() {
var c = nav.getAttribute('class') || '';

if (c.indexOf('show-force') !== -1) {
nav.setAttribute('class', c.replace(/show-force/, '').trim());
} else {
nav.setAttribute('class', (c + ' show-force').trim());
}
});
}
};

$(document).ready(function() {
appDaily.bindToggleButton();
});
appDaily.bindToggleButton();

0 comments on commit 7de2f62

Please sign in to comment.