Skip to content

Commit

Permalink
Do not inject a #app-navigation-toggle if there is already one
Browse files Browse the repository at this point in the history
This allows apps to ship their own, as in some cases the #app-content
element does not exist on page load and therefore the injection fails
and the icon is missing afterwards.

Fixes #14956

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Apr 10, 2019
1 parent d1e4d61 commit 708491a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/js/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,9 @@ function initCore() {
setTimeout(resizeMenu, 0);

// just add snapper for logged in users
if($('#app-navigation').length && !$('html').hasClass('lte9')) {
// and if the app doesn't handle the nav slider itself
if($('#app-navigation').length && !$('html').hasClass('lte9')
&& !$('#app-content').hasClass('no-snapper')) {

// App sidebar on mobile
var snapper = new Snap({
Expand All @@ -1202,6 +1204,7 @@ function initCore() {
minDragDistance: 100
});


$('#app-content').prepend('<div id="app-navigation-toggle" class="icon-menu" style="display:none;" tabindex="0"></div>');

var toggleSnapperOnButton = function(){
Expand Down

0 comments on commit 708491a

Please sign in to comment.