Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 0.8.13, fatal error, javascript, tiny scrollbar
- This topic has 9 replies, 2 voices, and was last updated 9 years, 4 months ago by
David Woods.
-
AuthorPosts
-
07/20/2014 at 5:50 pm #297610
David Woods
ParticipantHi Steven,
Love your plugin! I just purchased the Slim Plus template plugin, and I’m experiencing a problem.
If you go to this page, you’ll notice all the directory listings are open by default, and they will not close when clicked:
http://ehscougars.com/directory/teachers/
Any thoughts about what might be causing this? I’m guessing it’s some CSS or jQuery conflict between my custom theme code and Slim Plus, but not sure where to start.
Thank you.
07/21/2014 at 9:34 am #297640Steven Zahm
Keymaster@ David
The problem is being caused by the theme’s
plugins.js
file found here.The
update
function in the Tiny Scrollbar part of this script does not seem to exist (seems like the entire code was not copied in the file the theme dev) which is causing a fatal JavaScript error to occurring. This is likely causing any script after this error to not run, like the one for the Slim Plus template.You can see this see this error for yourself by opening the page up in Chrome, hit the F12 key and then click on the Console tab. On the far to right the line highlighting the error will be the filename, when you click on the file name you will be taken to that file where the error is happening.
There’s really only options to fix this… Ask the theme dev to fix the error, if you know JavaScript, you fix it and lastly, remove the part of the code in the file causing the error. If you decide to remove the part of the script causing the issue, this is the section of code to remove:
// Tiny Scrollbar (function(a) { a.tiny = a.tiny || {}; a.tiny.scrollbar = { options: { axis: "y", wheel: 40, scroll: true, lockscroll: true, size: "auto", sizethumb: "auto" } }; a.fn.tinyscrollbar = function(d) { var c = a.extend({}, a.tiny.scrollbar.options, d); this.each(function() { a(this).data("tsb", new b(a(this), c)) }); return this }; a.fn.tinyscrollbar_update = function(c) { return a(this).data("tsb").update(c) }; function b(q, g) { var k = this, t = q, j = { obj: a(".viewport", q) }, h = { obj: a(".overview", q) }, d = { obj: a(".scrollbar", q) }, m = { obj: a(".track", d.obj) }, p = { obj: a(".thumb", d.obj) }, l = g.axis === "x", n = l ? "left" : "top", v = l ? "Width" : "Height", r = 0, y = { start: 0, now: 0 }, o = {}, e = ("ontouchstart" in document.documentElement) ? true : false; function c() { k.update(); s(); return k } this.update = function(z) { j[g.axis] = j.obj[0]["offset" + v]; h[g.axis] = h.obj[0]["scroll" + v]; h.ratio = j[g.axis] / h[g.axis]; d.obj.toggleClass("disable", h.ratio >= 1); m[g.axis] = g.size === "auto" ? j[g.axis] : g.size; p[g.axis] = Math.min(m[g.axis], Math.max(0, (g.sizethumb === "auto" ? (m[g.axis] * h.ratio) : g.sizethumb))); d.ratio = g.sizethumb === "auto" ? (h[g.axis] / m[g.axis]) : (h[g.axis] - j[g.axis]) / (m[g.axis] - p[g.axis]); r = (z === "relative" && h.ratio <= 1) ? Math.min((h[g.axis] - j[g.axis]), Math.max(0, r)) : 0; r = (z === "bottom" && h.ratio <= 1) ? (h[g.axis] - j[g.axis]) : isNaN(parseInt(z, 10)) ? r : parseInt(z, 10); w() }; function w() { var z = v.toLowerCase(); p.obj.css(n, r / d.ratio); h.obj.css(n, -r); o.start = p.obj.offset()[n]; d.obj.css(z, m[g.axis]); m.obj.css(z, m[g.axis]); p.obj.css(z, p[g.axis]) } function s() { if (!e) { p.obj.bind("mousedown", i); m.obj.bind("mouseup", u) } else { j.obj[0].ontouchstart = function(z) { if (1 === z.touches.length) { i(z.touches[0]); z.stopPropagation() } } } if (g.scroll && window.addEventListener) { t[0].addEventListener("DOMMouseScroll", x, false); t[0].addEventListener("mousewheel", x, false) } else { if (g.scroll) { t[0].onmousewheel = x } } } function i(A) { var z = parseInt(p.obj.css(n), 10); o.start = l ? A.pageX : A.pageY; y.start = z == "auto" ? 0 : z; if (!e) { a(document).bind("mousemove", u); a(document).bind("mouseup", f); p.obj.bind("mouseup", f) } else { document.ontouchmove = function(B) { B.preventDefault(); u(B.touches[0]) }; document.ontouchend = f } } function x(B) { if (h.ratio < 1) { var A = B || window.event, z = A.wheelDelta ? A.wheelDelta / 120 : -A.detail / 3; r -= z * g.wheel; r = Math.min((h[g.axis] - j[g.axis]), Math.max(0, r)); p.obj.css(n, r / d.ratio); h.obj.css(n, -r); if (g.lockscroll || (r !== (h[g.axis] - j[g.axis]) && r !== 0)) { A = a.event.fix(A); A.preventDefault() } } } function u(z) { if (h.ratio < 1) { if (!e) { y.now = Math.min((m[g.axis] - p[g.axis]), Math.max(0, (y.start + ((l ? z.pageX : z.pageY) - o.start)))) } else { y.now = Math.min((m[g.axis] - p[g.axis]), Math.max(0, (y.start + (o.start - (l ? z.pageX : z.pageY))))) } r = y.now * d.ratio; h.obj.css(n, -r); p.obj.css(n, y.now) } } function f() { a(document).unbind("mousemove", u); a(document).unbind("mouseup", f); p.obj.unbind("mouseup", f); document.ontouchmove = document.ontouchend = null } return c() } }(jQuery));
Assuming this is not used anywhere and there are no other errors, this should fix it.
Hope that helps!
07/21/2014 at 1:58 pm #297673David Woods
ParticipantHi Steven,
Thank you for your quick reply! Thanks for pointing out that error. That plugins.js file is really only needed on the site home page, so I managed to modify the theme header so that the JS file only appears on the home page and not subpages like http://ehscougars.com/directory/teachers/.
However, after doing so, while the console error appears to be gone, the hide / show functionality of Slim Plus is still not working on http://ehscougars.com/directory/teachers/
I’ve tried a number of things, including a test where I deleted all my own CSS, a test where I deleted all other JS on the page including TypeKit and Google Analytics, enqueueing my own jQuery, but nothing seems to make it work. I also checked and unchecked settings in Connections : Settings : Advanced in just about every combination possible, and still nothing.
Any thoughts? For what it’s worth, my WordPress version is 3.9, Connections is version 0.8.14, and Slim Plus is version 2.0. I’ve tried a number of shortcode settings with this being my latest on that page:
[connections name_format='%last%, %first%' enable_category_select=FALSE enable_pagination=FALSE show_org=FALSE page_limit=200 show_alphaindex='false' image_fallback='none' enable_bio=FALSE template='slim-plus' order_by='last_name|SORT_ASC' category='1,5' exclude_category='2,3,4']
Thank you,
Dave
07/22/2014 at 12:40 pm #297770Steven Zahm
Keymaster@ David
Ok, I see this issue. I didn’t notice before because JS errors are just about always the cause … the template’s JS file is not being loaded for some reason. Well, the JS still may have likely caused a problem. Anyway…
I unfortunately run across this, very rarely thankfully… but for some reason there are themes due to the way they build pages break being able to enqueue a JS file mid page which is what Connections does so the template’s JS file is only loaded on the page in which it needs to be loaded on.
Can I get a temp admin account so I can take a closer look?
07/25/2014 at 1:05 am #297980David Woods
ParticipantThis reply has been marked as private.07/31/2014 at 2:21 pm #299202David Woods
ParticipantHi Steven,
Hope you are well. I just wanted to follow-up to my private reply last week, make sure the admin account info I gave worked for you. Curious to find out the cause of the problem. Thanks!
Dave
07/31/2014 at 5:28 pm #299280Steven Zahm
Keymaster@ David
Sorry, I never got the email notice letting me know you replied … seems to be a bug in the private reply plugin I use. I’ll have to track that down.
Any way, I just tried to login and it would not let me in. I stopped before being locked out … thinking I copy/pasted something wrong.
08/01/2014 at 1:05 pm #299311David Woods
ParticipantHi Steven,
Strange, I just tried the WP username and password for your account and it worked fine the first time. I’m guessing you’re right about the copy / paste error. Would you mind trying again?
Thanks,
Dave
08/02/2014 at 10:29 am #299408Steven Zahm
Keymaster@ David
Ok, the login issue was that i did not notice there was a single quote in the password. Copy/pasting that it was making it into a fancy single quote. After I fixed that, I was able to log in.
The issue was the theme lacked the wp_footer() template tag in the
footer.php
file. After I added it, the template started working as it should.Not having that template tag will break a lot of plugins so it’s best that it is there.
Hope that helps!
If you have a moment, I would truly appreciate a review as they really do make a difference. Many thanks in advance!
http://wordpress.org/support/view/plugin-reviews/connections08/04/2014 at 2:29 pm #299526David Woods
ParticipantWonderful, that did it! Thank you so much, Steven! Looks and works great now.
I will definitely leave a review over on http://wordpress.org/support/view/plugin-reviews/connections.
Thanks again,
Dave
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.