//= require jquery //= require jquery_ujs //= require ./bootstrap //= require ./js.cookie.js //= stub kuroko2/instance_linker //= require_tree //= require moment //= require bootstrap-sortable //= require select2 //= require vis jQuery(function ($) { $("[data-toggle='offcanvas']").click(function (e) { e.preventDefault(); //If window is small enough, enable sidebar push menu if ($(window).width() <= 992) { $('.row-offcanvas').toggleClass('active'); $('.left-side').removeClass("collapse-left"); $(".right-side").removeClass("strech"); $('.row-offcanvas').toggleClass("relative"); } else { //Else, enable content streching $('.left-side').toggleClass("collapse-left"); $(".right-side").toggleClass("strech"); } }); var showNotificationStatus = function () { if (Notification.permission === 'granted') { if (Cookies.get('notification') === 'on') { $('#notification').html(" on"); } else { $('#notification').html(" off"); } } else if (Notification.permission === 'denied') { $('#notification').html(" off"); } } $('#notification').click(function (e) { if (!('Notification' in window)) { return; } if (Notification.permission === 'default') { Notification.requestPermission(function (permission) { if (permission === "granted") { Cookies.set('notification', 'on'); } showNotificationStatus(); }); } else if (Notification.permission === 'granted') { if (Cookies.get('notification') === 'on') { Cookies.set('notification', 'off'); } else { Cookies.set('notification', 'on'); } showNotificationStatus(); } }); if ('Notification' in window) { showNotificationStatus(); } });