forked from sparkfabrik/company-playbook
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs sparkfabrik#56: Import jquery by webpack and reorganize js libra…
…ries
- Loading branch information
Marco Legramandi
committed
May 21, 2020
1 parent
dd6c56a
commit dee7743
Showing
5 changed files
with
53 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,2 @@ | ||
$(document).on('ready', function() { | ||
// to close all item of the menu (desktop version) | ||
$('#menu__general-toggle').change(function () { | ||
$('input[id^="menu__toggle-"]').prop('checked',this.checked); | ||
}); | ||
|
||
$('input[id^="menu__toggle-"]').change(function () { | ||
if ($('input[id^="menu__toggle-"]:checked').length == $('input[id^="menu__toggle-"]').length){ | ||
$('#menu__general-toggle').prop('checked',true); | ||
} | ||
else { | ||
$('#menu__general-toggle').prop('checked',false); | ||
} | ||
}); | ||
|
||
// add overflow:hidden to body on mobile version | ||
$('#menu__general-toggle').change(function () { | ||
if ( ($( window ).width()) <= 767) { | ||
if ($('#menu__general-toggle').is(':checked')) { | ||
$("body").css({"overflow":"visible"}); | ||
} else { | ||
$("body").css({"overflow":"hidden"}); | ||
} | ||
} | ||
}); | ||
$(window).on('resize', function(){ | ||
var win = $(this); //this = window | ||
if (win.height() >= 768) { | ||
$("body").removeAttr("style") | ||
} | ||
}); | ||
}); | ||
|
||
// Import custom project specific Javascript. | ||
import './custom.js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
$(window).on('load', function() { | ||
// to close all item of the menu (desktop version) | ||
$('#menu__general-toggle').change(function () { | ||
$('input[id^="menu__toggle-"]').prop('checked',this.checked); | ||
}); | ||
|
||
$('input[id^="menu__toggle-"]').change(function () { | ||
if ($('input[id^="menu__toggle-"]:checked').length == $('input[id^="menu__toggle-"]').length){ | ||
$('#menu__general-toggle').prop('checked',true); | ||
} | ||
else { | ||
$('#menu__general-toggle').prop('checked',false); | ||
} | ||
}); | ||
|
||
// add overflow:hidden to body on mobile version | ||
$('#menu__general-toggle').change(function () { | ||
if ( ($( window ).width()) <= 767) { | ||
if ($('#menu__general-toggle').is(':checked')) { | ||
$("body").css({"overflow":"visible"}); | ||
} else { | ||
$("body").css({"overflow":"hidden"}); | ||
} | ||
} | ||
}); | ||
$(window).on('resize', function(){ | ||
var win = $(this); //this = window | ||
if (win.height() >= 768) { | ||
$("body").removeAttr("style") | ||
} | ||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters