/* * To change this template, choose Tools | Templates * and open the template in the editor. */ var global_load = null; !function($) { $(function() { $body = $("body"); $(document).on({ ajaxStart: function() { $body.addClass("loading"); }, ajaxStop: function() { $body.removeClass("loading"); } }); function event(where){ $("#alert .alert").alert(); $("#popup").modal({'remote':false,'show':false}); $("#popup").on('show.bs.modal',function(e){ $.ajax({url:$(e.relatedTarget).attr("href"),success:function(data){ $("#popup .modal-title").html($(e.relatedTarget).attr("title")); $("#popup .modal-body").html($("#container div.box",data).html()); } ,error:function(data){}}); }); $(where+'.dropdown-toggle').dropdown(); $(where+" a").each(function(that){ if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff") $(this).click(function(e){ load($(this).attr('href'),{},($(this).attr('rel')=="tab")); return false; }); }); $(where+" form").submit(function(e){ if(!$(this).hasClass("hide-form") && $(this).attr('enctype')!='multipart/form-data' ){ e.stopPropagation(); //e.preventDefault(); if($(this).attr("back")) back=window.location.href; else back=null; load($(this).attr("action"),{data:$(this).serialize(), type:$(this).attr("method"),back:back},($(this).attr('rel')=="tab")); return false; } }); $(where+" form[ enctype *= 'multipart/form-data' ]").each(function(evt){ if (!$('#fileUpload').length) $('body').append('