[FA+] Post New Thread - Open page and jump to tags

#1
Website address(optional):
Bug Report Details:


Settings up my new XenForo site and I noticed that when you click 'Post New Thread' it open the page and then jump down to tags, and you need to scroll up.

I have tested this on the default style and it works fine.

I believe this could be an issue with another addon called Defer JS - Link to XF
 
Last edited:
#2
I have found a temp fix, till either you can fix it, or something else.

Add the below into the blacklist on Defer JS
Code:
jquery
xenforo.js
But it does seem to only affect Firefox, as Chrome, Opera and Internet Explorer seems fine
 

Russ

Pixel Exit Staff
#3
@GazCBG when you get a chance could you try undoing the fix you applied for Defer JS and disabling the floating navigation?

[XB] Header and Navigation

Does that resolve it for you?
 
#4
@Russ I don't use the floating nav bar.
Just to add I don't use any of the floating options, they all unticked.

But I did have a play around with the settings.

If I remove the fix in Defer JS and disable 'Enable Top User Bar' it is fine.

But as soon as I turn on: 'Enable Top User Bar 'and not apply the fix, it jumps down, to the tag area, till I re-apply the fix in Defer JS.
 

Russ

Pixel Exit Staff
#5
Well that confuses me even more in regards to finding a solution.

If you open the template: xb_top_bar you'll notice it's literally some basic html. There's no JS involved in that template what so ever so technically the Defer JS shouldn't effect it by blacklisting those files you mentioned.

Interesting...
 
#6
Hi,

I have just checked again and confirmed that is the case.
I also tried deleting everything in xb_top_bar without the Dejer JS blacklisting and it didn;t make any differents.

I have done a little bit more digging and I think the problem is somewhere is this bit of code in PAGE_CONTAINER template, as I removed it and it worked ok.

Code:
<xen:if is="@xb_user_bar AND !@xb_user_panel_header">
   <xen:if is="{$visitor.user_id}">
     <xen:include template="moderator_bar" />
   <xen:elseif is="!{$visitor.user_id} && !{$hideLoginBar}" />
     <xen:include template="login_bar" />
   </xen:if>
   <xen:else />
   <xen:if is="{$visitor.is_moderator} || {$visitor.is_admin}">
     <xen:include template="moderator_bar" />
   <xen:elseif is="!{$visitor.user_id} && !{$hideLoginBar}" />
     <xen:include template="login_bar" />
   </xen:if>
</xen:if>
 
#7
If I remove
Code:
<xen:include template="navigation_visitor_tab" />
From template: moderator_bar
It is ok.

Also if I remove the content of template: navigation_visitor_tab
It is ok
 
#8
It seem to do with this section in the file:
If you want I can try and pin point it a bit futher, by going line by line, but that will need to be tomorrow as, I am off the bed soon 11.30pm here in the UK.

Code:
  <!-- account -->
   <li class="navTab account Popup PopupControl PopupClosed {xen:if $tabs.account.selected, 'selected'}">

     <xen:set var="$visitorHiddenUnread" value="{xen:calc '{$visitor.alerts_unread} + {$visitor.conversations_unread}'}" />
     <a href="{xen:link account}" class="navLink accountPopup NoPopupGadget" rel="Menu"><strong class="accountUsername"><xen:if is="@xb_userBar_avatar"><img src="{xen:helper avatar, $visitor, s}" class="miniMe" alt="{$visitor_username}" /></xen:if><xen:if is="@xb_fa_visitor_tabs"><i class="fa fa-user fa-fw"></i></xen:if> <span class="xbVisitorText">{$visitor.username}</span></strong>
       <xen:if is="!@xb_user_bar">
       <strong class="itemCount ResponsiveOnly {xen:if $visitorHiddenUnread, '', 'Zero'}"
         id="VisitorExtraMenu_Counter">
         <span class="Total">{xen:number $visitorHiddenUnread}</span>
         <span class="arrow"></span>
       </strong>
       </xen:if>
     </a>
     <div class="xbTabPopupArrow">
       <span class="arrow"><span></span></span>
     </div>
     <div class="Menu JsOnly" id="AccountMenu">
       <div class="primaryContent menuHeader">
         <xen:avatar user="$visitor" size="m" class="NoOverlay plainImage" title="{xen:phrase view_your_profile}" />
        
         <h3><a href="{xen:link members, $visitor}" class="concealed" title="{xen:phrase view_your_profile}">{$visitor.username}</a></h3>
        
         <xen:if hascontent="true"><div class="muted"><xen:contentcheck>{xen:helper usertitle, $visitor}</xen:contentcheck></div></xen:if>
        
         <ul class="links">
           <li class="fl"><a href="{xen:link members, $visitor}">{xen:phrase your_profile_page}</a></li>
         </ul>
       </div>
       <div class="menuColumns secondaryContent">
         <ul class="col1 blockLinksList">
         <xen:hook name="navigation_visitor_tab_links1">
           <xen:if is="{$canEditProfile}"><li><a href="{xen:link account/personal-details}">{xen:phrase personal_details}</a></li></xen:if>
           <xen:if is="{$canEditSignature}"><li><a href="{xen:link account/signature}">{xen:phrase signature}</a></li></xen:if>
           <li><a href="{xen:link account/contact-details}">{xen:phrase contact_details}</a></li>
           <li><a href="{xen:link account/privacy}">{xen:phrase privacy}</a></li>
           <li><a href="{xen:link account/preferences}" class="OverlayTrigger">{xen:phrase preferences}</a></li>
           <li><a href="{xen:link account/alert-preferences}">{xen:phrase alert_preferences}</a></li>
           <xen:if is="{$canUploadAvatar}"><li><a href="{xen:link account/avatar}" class="OverlayTrigger" data-cacheOverlay="true">{xen:phrase avatar}</a></li></xen:if>
           <xen:if is="{$xenOptions.facebookAppId} OR {$xenOptions.twitterAppKey} OR {$xenOptions.googleClientId}"><li><a href="{xen:link account/external-accounts}">{xen:phrase external_accounts}</a></li></xen:if>
           <li><a href="{xen:link account/security}">{xen:phrase password}</a></li>
         </xen:hook>
         </ul>
         <ul class="col2 blockLinksList">
         <xen:hook name="navigation_visitor_tab_links2">
           <xen:if is="{$xenOptions.enableNewsFeed}"><li><a href="{xen:link account/news-feed}">{xen:phrase your_news_feed}</a></li></xen:if>
           <li><a href="{xen:link conversations}">{xen:phrase conversations}
             <strong class="itemCount {xen:if $visitor.conversations_unread, '', 'Zero'}"
               id="VisitorExtraMenu_ConversationsCounter">
               <span class="Total">{xen:number $visitor.conversations_unread}</span>
             </strong></a></li>
           <li><a href="{xen:link account/alerts}">{xen:phrase alerts}
             <strong class="itemCount {xen:if $visitor.alerts_unread, '', 'Zero'}"
               id="VisitorExtraMenu_AlertsCounter">
               <span class="Total">{xen:number $visitor.alerts_unread}</span>
             </strong></a></li>
           <li><a href="{xen:link account/likes}">{xen:phrase likes_youve_received}</a></li>
           <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}'}">{xen:phrase your_content}</a></li>
           <li><a href="{xen:link account/following}">{xen:phrase people_you_follow}</a></li>
           <li><a href="{xen:link account/ignored}">{xen:phrase people_you_ignore}</a></li>
           <xen:if is="{$xenCache.userUpgradeCount}"><li><a href="{xen:link account/upgrades}">{xen:phrase account_upgrades}</a></li></xen:if>
           <li><a href="{xen:link account/two-step}">{xen:phrase two_step_verification}</a></li>
         </xen:hook>
         </ul>
       </div>
       <div class="menuColumns secondaryContent">
         <ul class="col1 blockLinksList">
           <li>        
             <form action="{xen:link account/toggle-visibility}" method="post" class="AutoValidator visibilityForm">
               <label><input type="checkbox" name="visible" value="1" class="SubmitOnChange" {xen:checked $visitor.visible} />
                 {xen:phrase show_online_status}</label>
               <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
             </form>
           </li>
         </ul>
         <ul class="col2 blockLinksList">
           <li><a href="{xen:link logout, '', '_xfToken={$visitor.csrf_token_page}'}" class="LogOut">{xen:phrase log_out}</a></li>
         </ul>
       </div>
       <xen:if is="{$canUpdateStatus}">
         <form action="{xen:link members/post, $visitor}" method="post" class="sectionFooter statusPoster AutoValidator" data-optInOut="OptIn">
           <textarea name="message" class="textCtrl StatusEditor UserTagger Elastic" placeholder="{xen:phrase update_your_status}..." rows="1" cols="40" style="height:18px" data-statusEditorCounter="#visMenuSEdCount" data-nofocus="true"></textarea>
           <div class="submitUnit">
             <span id="visMenuSEdCount" title="{xen:phrase characters_remaining}"></span>
             <input type="submit" class="button primary MenuCloser" value="{xen:phrase post_verb}" />
             <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
             <input type="hidden" name="return" value="1" />
           </div>
         </form>
       </xen:if>
     </div>    
   </li>
 
Last edited:
#9
Hi,

I can't seem to pin point it, but I can say, the problem appears to be in: navigation_visitor_tab
As when you remove the content, it is fine, when you remove the above code, in my last message it still drop a bit.
 

Russ

Pixel Exit Staff
#10
Do you have your user bar in the moderator bar or the default location? I'll be able to try to troubleshoot myself further tomorrow.
 

Russ

Pixel Exit Staff
#13
Can you disable...

Style Properties -> [XB] General Setup -> Go to top/bottom(both)
And the Off-Canvas menu: Style Properties: └ ─ Mobile Enhancements

That's the only custom JS which loading on your site from the style itself.
 
#14
Hi,

That didn't work, so I did the following

1. Untick (disable) all addons but for Defer JS.

2. Went to the problem pages (New Threads and /account/) and viewed the source code with Defer JS On and Off and compared the source code.

3. I then made sure Defer JS was on and blacklisted 'function'
This fixed the issues, so I view the source again, and noticed the below JS, so to make sure it was the right JS I removed 'function' on the blacklist and added 'var items = $('.xbOffCanvasMask, .slideLeft')'

So my Dejer JS blacklist looked like
Code:
adsbygoogle
google_ad
show_ad
var items = $('.xbOffCanvasMask, .slideLeft')
This seems to be working.

4. I then unticked/disabled:
[XB] General Setup - > Mobile Enhancements -> Enable Off-Canvas Menu

Then went back and checked the page and the problem had come back with it jumping down.
So I view the source code and it had removed the JS code.

As soon as I enable Enable Off-Canvas Menu it works, with the above blacklist in Defer JS.


The JS code:

Code:
<script type='text/javascript'>
$(function() {
var items = $('.xbOffCanvasMask, .slideLeft');
var xbOffCanvasContent = $('.xbOffCanvasContent');
var xbOffCanvasOpen = function() {
$(items).removeClass('xbOffCanvasClose').addClass('xbOffCanvasOpen');
}
var xbOffCanvasClose = function() {
$(items).removeClass('xbOffCanvasOpen').addClass('xbOffCanvasClose');
}
$('#xbOffCanvasToggle').click(function() {
if (xbOffCanvasContent.hasClass('xbOffCanvasOpen')) {
$(xbOffCanvasClose)
} else {
$(xbOffCanvasOpen)
}
});
xbOffCanvasContent.click(function() {
if (xbOffCanvasContent.hasClass('xbOffCanvasOpen')) {
$(xbOffCanvasClose)
}
});
$('#xbOffCanvasToggle,.xbOffCanvasMask').on('click', function() {
$('.xbOffCanvasContainer').toggleClass("marginLeft");
});
$('.publicTabs li').has('.xbOffCanvasSubMenu').prepend('<span class="xbOffCanvasArrow"><i class="xbOffCanvasExpand fa fa-chevron-down"></i></span>');
$('.xbOffCanvasArrow').click(function() {
$(this).siblings('.xbOffCanvasSubMenu, .secondaryContent.blockLinksList').slideToggle('fast');
$(this).children('.xbOffCanvasExpand').toggleClass('fa-flip-vertical ');
});
});
</script>
 

Pre-Sale Questions

If you have any questions or concerns you want to ask before you make a purchase don't hesitate to use one of our multiple support channels for your convenience.