MIF_E31220215/public/assets_admin/assets/js/common-pages.js

63 lines
2.3 KiB
JavaScript

"use strict";
$(document).ready(function() {
// wave effect js
Waves.init();
Waves.attach('.flat-buttons', ['waves-button']);
Waves.attach('.float-buttons', ['waves-button', 'waves-float']);
Waves.attach('.float-button-light', ['waves-button', 'waves-float', 'waves-light']);
Waves.attach('.flat-buttons', ['waves-button', 'waves-float', 'waves-light', 'flat-buttons']);
$(document).ready(function(){
$(".header-notification").click(function(){
$(this).find(".show-notification").slideToggle(500);
$(this).toggleClass('active');
});
});
$(document).on("click", function(event){
var $trigger = $(".header-notification");
if($trigger !== event.target && !$trigger.has(event.target).length){
$(".show-notification").slideUp(300);
$(".header-notification").removeClass('active');
}
});
$('.theme-loader').animate({
'opacity': '0',
}, 1200);
setTimeout(function() {
$('.theme-loader').remove();
}, 2000);
// $('.pcoded').addClass('loaded');
$('.form-control').on('blur', function() {
if ($(this).val().length > 0) {
$(this).addClass("fill");
} else {
$(this).removeClass("fill");
}
});
$('.form-control').on('focus', function() {
$(this).addClass("fill");
});
});
function toggleFullScreen() {
var a = $(window).height() - 10;
if (!document.fullscreenElement && // alternative standard method
!document.mozFullScreenElement && !document.webkitFullscreenElement) { // current working methods
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
} else {
if (document.cancelFullScreen) {
document.cancelFullScreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
}