amitabhaghosh197
2/10/2015 - 1:49 PM

standar js

standar js

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/* Check this Page is working or not */

//$(window).load(function(){
    //alert('Hi');
//});

    /* GLOBAL WIDTH & HEIGHT VARIABLES */
    var width = viewportSize.getWidth();
    var height = viewportSize.getHeight(); 

var sketchAmitabha = function(){
var dropdownLeftPanel = function(){
    
    var bodyLeft = $('.das_body_left');
    var body = $('body');
    // adds a class 'ag-dropdown' to ul 'list1' on load
    bodyLeft.find('ul.list1').addClass('ag-dropdown');
    body.addClass('ag-left-sidebar');
    
   // adds and remove class'ag-dropdown' on click event
   //adds and removes attribute dropdown-toggle on click event
   //
   $('.menu_icon').on("click",function(e){
       e.preventDefault();
       if(bodyLeft.hasClass('spred')){
          $('ul.list1').removeClass('ag-dropdown');
          body.removeClass('ag-left-sidebar');
          $('ul.list1 li.dropdown').find('a.dropdown-toggle').attr("data-toggle","dropdown");
          $('ul.dropdown-menu').removeClass('dropdown-menu-position');
          
       }else {
           
         $('ul.list1').addClass('ag-dropdown'); 
         body.addClass('ag-left-sidebar');
         $('ul.list1 li.dropdown').find('a.dropdown-toggle').removeAttr("data-toggle","dropdown");
         $('ul.list1 li.dropdown').removeClass('open');
         $('ul.dropdown-menu').addClass('dropdown-menu-position');
         $('ul.list1 li span').css({"opacity":"0"});
        
         
         
       }// end of if else
         
    
  
   });//menu-icon click event
   
  
    
};//dropdownLeftPanel
 
 var sideBarHandle = function(){
     
     var sidebarHeight = height - $('.top').outerHeight() - $('.footer').outerHeight();
     
     if($('body').hasClass('ag-left-sidebar')){
         $('.das_body_left').css({"height" : sidebarHeight  });
         $('.das_body_middle').css({"height" : sidebarHeight  });
     }
 }//sideBarHandle()
 
 var disablePoshytip = function(){
     
     $('ul.list1 li').hover(function(){
       $('.demo-basic').poshytip('destroy').removeAttr('title');  
     });
         
     
     
     
 }//disablePoshytip()
 
 
 var fixedWindow = function(){
     
     $(window).scroll(function(){
         if($(this).scrollTop() >=200){
             var Top_ht = $('.top').outerHeight() + 10;
             $('.main-content').css({"position":"fixed", "width": "100%", "top":Top_ht, "padding-left":"20px", "padding-right":"20px"}).addClass('animated fadeInDown');
             /* To fix Later on */
         } else if($(this).scrollTop() ===0){
             $('.main-content').css({"position":"relative", "width": "100%", "top":"0","padding-left":"20px", "padding-right":"20px"}).removeClass('animated fadeInDown');
         }
     });
 }
 
 var removePortletHeader = function(){
     
     $('.portlet .remove-icon').toggle( function(){
                 $('.portlet-header').hide();
                 $('.portlet-body').css({"padding-top":"40px"});
                 $(this).addClass('add-icon').removeClass('remove-icon');
             },
             function(){
                 $('.portlet-header').show();
                 $('.portlet-body').css({"padding-top":"0px"});
                 $(this).addClass('remove-icon').removeClass('add-icon');
             }
             );//
     
 }
 
 var datePicker_bfn = function(){
     
     //$('.bfh-datepicker').children('i').hasClass('glyphicon glyphicon-calendar').removeClass('glyphicon glyphicon-calendar').addClass('fa fa-calendar');
    //$().bfhdatepicker({icon: 'fa fa-calendar'})
 }
/* Return init Functions */
return{
    
    init: function(){
       dropdownLeftPanel(); 
       sideBarHandle();
       disablePoshytip();
       fixedWindow();
       removePortletHeader();
       datePicker_bfn();
       
    }//return
}//return inits

}();// end of sketchAmitabha

var $ = jQuery.noConflict();
$(document).ready(function(){
    
    sketchAmitabha.init();
    
    
});