WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] Drop Down Menus accross site stopped working (3 posts)

  1. admdisco
    Member
    Posted 1 year ago #

    Since installing the Events calendar 2.0.10 my navigation menu no longer displays its dropdown tiers. Also, my entire site is aligned in the center of the screen but the events pages in list and calendar view make the site hug the left hand side of the screen.

    I really like the plug in and hope to get it working. I spent a while yesterday importing events and id hate to have to do it again :(

    Any help greatly appreciated

    heres my site

    Thanks for reading me!

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. ebloss
    Member
    Posted 1 year ago #

    I'm having the same problem. We upgraded the plugin to 2.0.10 on the 7th and it broke the menus. As soon as I deactivate the plugin, the menus start working again. I'm running WordPress 3.4.2 with a theme from ThemeForest (Jewelry Store Dark). The site is a-ha-design.com but I've got the plugin deactivated so you won't be able to see how it's broken.

    It works in IE9 for me, but does NOT work in Firefox, Chrome, Opera, or Safari. All work fine after deactivating the plugin.

    Chrome reports an error at line 5 in jquery.pjax.js:
    Uncaught TypeError: Object #<Object> has no method 'on'

    // jquery.pjax.js
    // copyright chris wanstrath
    // https://github.com/defunkt/jquery-pjax
    
    (function($){function fnPjax(selector,container,options){var context=this;return this.on("click.pjax",selector,function(event){var opts=$.extend({},optionsFor(container,options));if(!opts.container){opts.container=$(this).attr("data-pjax")||context;}handleClick(event,opts);});}function handleClick(event,container,options){options=optionsFor(container,options);var link=event.currentTarget;if(link.tagName.toUpperCase()!=="A"){throw"$.fn.pjax or $.pjax.click requires an anchor element";}if(event.which>1||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey){return;}if(location.protocol!==link.protocol||location.host!==link.host){return;}if(link.hash&&link.href.replace(link.hash,"")===location.href.replace(location.hash,"")){return;}if(link.href===location.href+"#"){return;}var defaults={url:link.href,container:$(link).attr("data-pjax"),target:link,fragment:null};pjax($.extend({},defaults,options));event.preventDefault();}function handleSubmit(event,container,options){options=optionsFor(container,options);var form=event.currentTarget;if(form.tagName.toUpperCase()!=="FORM"){throw"$.pjax.submit requires a form element";}var defaults={type:form.method,url:form.action,data:$(form).serializeArray(),container:$(form).attr("data-pjax"),target:form,fragment:null,timeout:0};pjax($.extend({},defaults,options));event.preventDefault();}function pjax(options){options=$.extend(true,{},$.ajaxSettings,pjax.defaults,options);if($.isFunction(options.url)){options.url=options.url();}var target=options.target;var hash=parseURL(options.url).hash;var context=options.context=findContainerFor(options.container);if(!options.data){options.data={};}options.data._pjax=context.selector;function fire(type,args){var event=$.Event(type,{relatedTarget:target});context.trigger(event,args);return !event.isDefaultPrevented();}var timeoutTimer;options.beforeSend=function(xhr,settings){if(settings.type!=="GET"){settings.timeout=0;}if(settings.timeout>0){timeoutTimer=setTimeout(function(){if(fire("pjax:timeout",[xhr,options])){xhr.abort("timeout");}},settings.timeout);settings.timeout=0;}xhr.setRequestHeader("X-PJAX","true");xhr.setRequestHeader("X-PJAX-Container",context.selector);var result;if(!fire("pjax:beforeSend",[xhr,settings])){return false;}options.requestUrl=parseURL(settings.url).href;};options.complete=function(xhr,textStatus){if(timeoutTimer){clearTimeout(timeoutTimer);}fire("pjax:complete",[xhr,textStatus,options]);fire("pjax:end",[xhr,options]);};options.error=function(xhr,textStatus,errorThrown){var container=extractContainer("",xhr,options);var allowed=fire("pjax:error",[xhr,textStatus,errorThrown,options]);if(textStatus!=="abort"&&allowed){locationReplace(container.url);}};options.success=function(data,status,xhr){var container=extractContainer(data,xhr,options);if(!container.contents){locationReplace(container.url);return;}pjax.state={id:options.id||uniqueId(),url:container.url,title:container.title,container:context.selector,fragment:options.fragment,timeout:options.timeout};if(options.push||options.replace){window.history.replaceState(pjax.state,container.title,container.url);}if(container.title){document.title=container.title;}context.html(container.contents);if(typeof options.scrollTo==="number"){$(window).scrollTop(options.scrollTo);}if((options.replace||options.push)&&window._gaq){_gaq.push(["_trackPageview"]);}if(hash!==""){var url=parseURL(container.url);url.hash=hash;pjax.state.url=url.href;window.history.replaceState(pjax.state,container.title,url.href);var target=$(url.hash);if(target.length){$(window).scrollTop(target.offset().top);}}fire("pjax:success",[data,status,xhr,options]);};if(!pjax.state){pjax.state={id:uniqueId(),url:window.location.href,title:document.title,container:context.selector,fragment:options.fragment,timeout:options.timeout};window.history.replaceState(pjax.state,document.title);}var xhr=pjax.xhr;if(xhr&&xhr.readyState<4){xhr.onreadystatechange=$.noop;xhr.abort();}pjax.options=options;var xhr=pjax.xhr=$.ajax(options);if(xhr.readyState>0){if(options.push&&!options.replace){cachePush(pjax.state.id,context.clone().contents());window.history.pushState(null,"",stripPjaxParam(options.requestUrl));}fire("pjax:start",[xhr,options]);fire("pjax:send",[xhr,options]);}return pjax.xhr;}function pjaxReload(container,options){var defaults={url:window.location.href,push:false,replace:true,scrollTo:false};return pjax($.extend(defaults,optionsFor(container,options)));}function locationReplace(url){window.history.replaceState(null,"","#");window.location.replace(url);}function onPjaxPopstate(event){var state=event.state;if(state&&state.container){var container=$(state.container);if(container.length){var contents=cacheMapping[state.id];if(pjax.state){var direction=pjax.state.id<state.id?"forward":"back";cachePop(direction,pjax.state.id,container.clone().contents());}var popstateEvent=$.Event("pjax:popstate",{state:state,direction:direction});container.trigger(popstateEvent);var options={id:state.id,url:state.url,container:container,push:false,fragment:state.fragment,timeout:state.timeout,scrollTo:false};if(contents){container.trigger("pjax:start",[null,options]);if(state.title){document.title=state.title;}container.html(contents);pjax.state=state;container.trigger("pjax:end",[null,options]);}else{pjax(options);}container[0].offsetHeight;}else{locationReplace(location.href);}}}function fallbackPjax(options){var url=$.isFunction(options.url)?options.url():options.url,method=options.type?options.type.toUpperCase():"GET";var form=$("<form>",{method:method==="GET"?"GET":"POST",action:url,style:"display:none"});if(method!=="GET"&&method!=="POST"){form.append($("<input>",{type:"hidden",name:"_method",value:method.toLowerCase()}));}var data=options.data;if(typeof data==="string"){$.each(data.split("&"),function(index,value){var pair=value.split("=");form.append($("<input>",{type:"hidden",name:pair[0],value:pair[1]}));});}else{if(typeof data==="object"){for(key in data){form.append($("<input>",{type:"hidden",name:key,value:data[key]}));}}}$(document.body).append(form);form.submit();}function uniqueId(){return(new Date).getTime();}function stripPjaxParam(url){return url.replace(/\?_pjax=[^&]+&?/,"?").replace(/_pjax=[^&]+&?/,"").replace(/[\?&]$/,"");}function parseURL(url){var a=document.createElement("a");a.href=url;return a;}function optionsFor(container,options){if(container&&options){options.container=container;}else{if($.isPlainObject(container)){options=container;}else{options={container:container};}}if(options.container){options.container=findContainerFor(options.container);}return options;}function findContainerFor(container){container=$(container);if(!container.length){throw"no pjax container for "+container.selector;}else{if(container.selector!==""&&container.context===document){return container;}else{if(container.attr("id")){return $("#"+container.attr("id"));}else{throw"cant get selector for pjax container!";}}}}function findAll(elems,selector){return elems.filter(selector).add(elems.find(selector));}function extractContainer(data,xhr,options){var obj={};obj.url=stripPjaxParam(xhr.getResponseHeader("X-PJAX-URL")||options.requestUrl);if(/<html/i.test(data)){var $head=$(data.match(/<head[^>]*>([\s\S.]*)<\/head>/i)[0]);var $body=$(data.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0]);}else{var $head=$body=$(data);}if($body.length===0){return obj;}obj.title=findAll($head,"title").last().text();if(options.fragment){if(options.fragment==="body"){var $fragment=$body;}else{var $fragment=findAll($body,options.fragment).first();}if($fragment.length){obj.contents=$fragment.contents();if(!obj.title){obj.title=$fragment.attr("title")||$fragment.data("title");}}}else{if(!/<html/i.test(data)){obj.contents=$body;}}if(obj.contents){obj.contents=obj.contents.not("title");obj.contents.find("title").remove();}if(obj.title){obj.title=$.trim(obj.title);}return obj;}var cacheMapping={};var cacheForwardStack=[];var cacheBackStack=[];function cachePush(id,value){cacheMapping[id]=value;cacheBackStack.push(id);while(cacheForwardStack.length){delete cacheMapping[cacheForwardStack.shift()];}while(cacheBackStack.length>pjax.defaults.maxCacheLength){delete cacheMapping[cacheBackStack.shift()];}}function cachePop(direction,id,value){var pushStack,popStack;cacheMapping[id]=value;if(direction==="forward"){pushStack=cacheBackStack;popStack=cacheForwardStack;}else{pushStack=cacheForwardStack;popStack=cacheBackStack;}pushStack.push(id);if(id=popStack.pop()){delete cacheMapping[id];}}function enable(){$.fn.pjax=fnPjax;$.pjax=pjax;$.pjax.enable=$.noop;$.pjax.disable=disable;$.pjax.click=handleClick;$.pjax.submit=handleSubmit;$.pjax.reload=pjaxReload;$.pjax.defaults={timeout:650,push:true,replace:false,type:"GET",dataType:"html",scrollTo:0,maxCacheLength:20};$(window).bind("popstate.pjax",onPjaxPopstate);}function disable(){$.fn.pjax=function(){return this;};$.pjax=fallbackPjax;$.pjax.enable=enable;$.pjax.disable=$.noop;$.pjax.click=$.noop;$.pjax.submit=$.noop;$.pjax.reload=window.location.reload;$(window).unbind("popstate.pjax",onPjaxPopstate);}if($.inArray("state",$.event.props)<0){$.event.props.push("state");}$.support.pjax=window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/);$.support.pjax?enable():disable();})(jQuery);

    Hope this helps! Thank you very much.

  3. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Hey folks. Thanks for the heads up here. We've had a few reports of this and it's due to the fact that we updated the jQuery used in 2.0.10 so that it was current and compliant with WP's standards.

    As a result, certain themes/sites that aren't running the latest jQuery saw things break. When I just checked the version of jQuery running on your site there, admdisco, it is 1.3.2; since The Events Calendar uses whatever version of jQuery ships with WP (as of 3.5, this is at least 1.7.2), any site running below 1.7.2 is going to encounter problems. It looks like in your case either your theme or another plugin is swapping the default jQuery for some older version, which is leading to these display problems.

    Sorry I couldn't offer up more. If you can find out what the conflict is caused by, I would definitely encourage updating so that you can run the latest 2.0.10 release (which includes a number of stability improvements over 2.0.9). If you have any other questions I can answer to help ease that, please do let us know.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic