/** * Theme: Moltran Admin Template * Author: Coderthemes * Module/App: Main Js */ (function($){ 'use strict'; function initNavbar () { $('.navbar-toggle').on('click', function(event) { $(this).toggleClass('open'); $('#navigation').slideToggle(400); }); $('.navigation-menu>li').slice(-1).addClass('last-elements'); $('.navigation-menu li.has-submenu a[href="#"]').on('click', function(e) { if ($(window).width() < 992) { e.preventDefault(); $(this).parent('li').toggleClass('open').find('.submenu:first').toggleClass('open'); } }); } function init () { initNavbar(); } init(); })(jQuery), //portlets function($) { "use strict"; /** Portlet Widget */ var Portlet = function() { this.$body = $("body"), this.$portletIdentifier = ".portlet", this.$portletCloser = '.portlet a[data-toggle="remove"]', this.$portletRefresher = '.portlet a[data-toggle="reload"]' }; //on init Portlet.prototype.init = function() { // Panel closest var $this = this; $(document).on("click",this.$portletCloser, function (ev) { ev.preventDefault(); var $portlet = $(this).closest($this.$portletIdentifier); var $portlet_parent = $portlet.parent(); $portlet.remove(); if ($portlet_parent.children().length == 0) { $portlet_parent.remove(); } }); // Panel Reload $(document).on("click",this.$portletRefresher, function (ev) { ev.preventDefault(); var $portlet = $(this).closest($this.$portletIdentifier); // This is just a simulation, nothing is going to be reloaded $portlet.append('
'); var $pd = $portlet.find('.panel-disabled'); setTimeout(function () { $pd.fadeOut('fast', function () { $pd.remove(); }); }, 500 + 300 * (Math.random() * 5)); }); }, // $.Portlet = new Portlet, $.Portlet.Constructor = Portlet }(window.jQuery), //main app module function($) { "use strict"; var MoltranApp = function() { this.VERSION = "1.5.0", this.AUTHOR = "Coderthemes", this.SUPPORT = "coderthemes@gmail.com", this.pageScrollElement = "html, body", this.$body = $("body") }; //initializing tooltip MoltranApp.prototype.initTooltipPlugin = function() { $.fn.tooltip && $('[data-toggle="tooltip"]').tooltip() }, //initializing popover MoltranApp.prototype.initPopoverPlugin = function() { $.fn.popover && $('[data-toggle="popover"]').popover() }, //initializing nicescroll MoltranApp.prototype.initNiceScrollPlugin = function() { //You can change the color of scroll bar here $.fn.niceScroll && $(".nicescroll").niceScroll({ cursorcolor: '#9d9ea5', cursorborderradius: '0px'}); }, //initilizing MoltranApp.prototype.init = function() { var $this = this; this.initTooltipPlugin(), this.initPopoverPlugin(), this.initNiceScrollPlugin(), //creating portles $.Portlet.init(); }, $.MoltranApp = new MoltranApp, $.MoltranApp.Constructor = MoltranApp }(window.jQuery), //initializing main application module function($) { "use strict"; $.MoltranApp.init(); }(window.jQuery); var wow = new WOW( { boxClass: 'wow', // animated element css class (default is wow) animateClass: 'animated', // animation css class (default is animated) offset: 50, // distance to the element when triggering the animation (default is 0) mobile: false // trigger animations on mobile devices (true is default) } ); wow.init();