From 505b15b5cd52a85aef298e12af70a533ee4c450f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Wed, 14 May 2014 00:06:53 +0200 Subject: [PATCH] js chrome und ie --- app/webroot/js/dreamjob.js | 430 +++++++++++++++++++------------------ 1 file changed, 226 insertions(+), 204 deletions(-) diff --git a/app/webroot/js/dreamjob.js b/app/webroot/js/dreamjob.js index df5fea2..d8bed27 100755 --- a/app/webroot/js/dreamjob.js +++ b/app/webroot/js/dreamjob.js @@ -2,230 +2,252 @@ * To change this template, choose Tools | Templates * and open the template in the editor. */ - var global_load = null; +var global_load = null; !function($) { - $(function() { - $body = $("body"); - $(document).on({ - ajaxStart: function() { $body.addClass("loading"); }, - ajaxStop: function() { $body.removeClass("loading"); } - }); - $(window).bind('popstate',function(evt){ - console.log(evt.target.pageurl); - console.log(evt); - if(evt.originalEvent.state !== null) { - load(location.href,{'history':false},false); - } - }); - $("#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){}}); - }); - function stopLoad(e){ - if (!e) - e = window.event; - if (e.preventDefault) - e.preventDefault(); - if (e.stopPropagation) { - e.stopPropagation(); - }else{ - e.cancelBubble = true; - } - } - function event(where){ - /* Hotfix Ticket: 215*/ - $(where+' img').each(function(){ $(this).attr('src',$(this).attr('src')+ '?' + (new Date()).getTime()); }); - - $("#alert .alert").alert(); - $(where+' textarea').wysihtml5(); - $(where+' select').each(function(){ - $(this).select2({allowClear: true}); - }); - $(where+' .dropdown-toggle').dropdown(); - $(where+" a").tooltip();; - $(where+" a").each(function(that){ - if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff" && !$(this).parents('ul').hasClass("wysihtml5-toolbar") && !$(this).hasClass(".select2-choice") && !$(this).parents('form').hasClass('tableForm')) - $(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' ){ - $(":input[ name *= '_wysihtml5_mod' ]",this).remove(); - //stopLoad(e); - 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('