Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • activha Friend
    #184620

    When voting for K2 items which are located very down the page, the voting result always brings back to the top of the page, then you dont know where you were 🙁

    How can I solve this ?

    Luna Garden Moderator
    #482325

    Hello Activha,

    Can you describe the issue in more details and a screenshot perhaps? I have check JA Wall on demo, with several style, the Voting place is on top, right below the title article, like this capture: http://easycaptures.com/fs/uploaded/535/9900066584.jpg not in very down the page as you said.

    activha Friend
    #482364

    <em>@”Luna Garden 358603″ wrote:</em><blockquote>Hello Activha,

    Can you describe the issue in more details and a screenshot perhaps? I have check JA Wall on demo, with several style, the Voting place is on top, right below the title article, like this capture: http://easycaptures.com/fs/uploaded/535/9900066584.jpg not in very down the page as you said.</blockquote>

    The location is fine !
    Only the voting action bugs and sends back to top once the vote is registered

    Luna Garden Moderator
    #482478

    Hello,

    I have checked again on our demo, but no error action as you said.

    Please try on our demo here http://joomla25-templates.joomlart.com/ja_wall/default/k2.html and tell me if it has the same error as your site.

    If yes, PM me your site link that shows the error for further checking

    activha Friend
    #482599

    The link that you gave me for the demo cannot work as it does not show voting ! 🙂

    Please try with http://activ-ha.com/activations

    Browse at the bottom or just display 20 articles more, then try to vote for one on the stars and you’ll understand the problem.

    Wall Crasher Developer
    #482649

    Hi activha,

    Infinity scroll load new items via AJAX, so you need to re-apply those rating javascript to those item.
    Here are two way you can try
    1. Open /components/com_k2/js/k2.js and change on line 123

    $K2('.itemRatingForm a').click(function(event){
    to

    $K2('.itemRatingForm a').live('click', function(event){

    2. Open /templates/ja_wall/js/wall.js and add

    // Rating
    $newElems.find('.itemRatingForm a').click(function(event){
    event.preventDefault();
    var itemID = $K2(this).attr('rel');
    var log = $K2('#itemRatingLog' + itemID).empty().addClass('formLogLoading');
    var rating = $K2(this).html();
    $K2.ajax({
    url: K2SitePath+"index.php?option=com_k2&view=item&task=vote&format=raw&user_rating=" + rating + "&itemID=" + itemID,
    type: 'get',
    success: function(response){
    log.removeClass('formLogLoading');
    log.html(response);
    $K2.ajax({
    url: K2SitePath+"index.php?option=com_k2&view=item&task=getVotesPercentage&format=raw&itemID=" + itemID,
    type: 'get',
    success: function(percentage){
    $K2('#itemCurrentRating' + itemID).css('width', percentage + "%");
    setTimeout(function(){
    $K2.ajax({
    url: K2SitePath+"index.php?option=com_k2&view=item&task=getVotesNum&format=raw&itemID=" + itemID,
    type: 'get',
    success: function(response){
    log.html(response);
    }
    });
    }, 2000);
    }
    });
    }
    });
    });

    just after line 226

    You should use one of these two options.

    Hope it helps.

    Regards

    activha Friend
    #482739

    Well we went for option 2 in order to keep it in the future whatever version of K2

    It works very well, thanks a lot for helping 🙂

    activha Friend
    #483460

    Well seems like I wrote too quickly

    It looks like it breaks the ability to input username and password correctly in our login in sidebar module on iPad

    Each time that we try to input username, the field is then sent to the bottom of the page and it’s very difficult to input it.

    Could it come from this modification ? could you test on http://activ-ha.com on ipad ? try to input a name in the login field located at the bottom left in the sidebar

    Wall Crasher Developer
    #483529

    Hi activha,

    This issue is not related to the issue above.
    As by default JA Wall does not support form element on the sidebar. IDevice has many issue related to fixed position, and virtual keyboard.
    I can also see that you have enable form element for iScroll plugin.

    You can make a workaround of this issue by.

    1. Add following block code to templatesja_walljsscript.js at line window.sidebarIScroll = new iScroll(…..); (569)

    jsidebar.on('focusin', function (argument) {
    window.sidebarFocus = true;
    if(window.sidebarIScroll){

    jsidebar.one('blur', function (argument) {

    window.sidebarFocus = false;
    $(window).trigger('scroll');
    });
    }
    });

    2. Change the scroll event function like this (line 590)

    $(window).scroll(function(){
    if(!window.sidebarFocus){
    lastScroll = $(window).scrollTop();
    $('#dummy-toggle').css('top', lastScroll);

    if(JawallMenu.isTablet){
    clearTimeout(scrollid);
    scrollid = setTimeout(function(){
    lastScroll = $(window).scrollTop();
    scrollid = setTimeout(function(){
    if(lastScroll == $(window).scrollTop()){
    jsidebar
    .css('top', lastScroll + parseFloat(jsidebar.css('top', '').css('top')))
    .css('position', 'absolute');

    $(document).one('touchmove', function(){
    jsidebar.css({position: 'fixed', top: ''});
    });
    }
    }, 100);
    }, 100);
    }
    }
    });

    Save and check again.
    Regards

    activha Friend
    #483560

    Well I’m on iPad now and the fix works ok.
    Will test further on desktop and android browsers

    Thanks already 🙂

    activha Friend
    #484180

    Well I don’t know if this comes from the code above but I have noticed that since then each time that the website is opened on an iPad the screen flicks a lot

    I mean that at each new page the top menu bar disappear then is reloaded again, sometime freezing.

    Are you sure that the change in code for wall.js did not affect screen rendering on ipad ?

    It looks very weird when switching pages and the behavior is very nice in desktop browser.

    Thanks for looking 🙂

    Wall Crasher Developer
    #484344

    Hi activha,

    I am not sure about the flick on Ipad.
    But IDevice have some know issue about fixed position and we have two fixed positions on JA Wall (the top menu and the left sidebar).
    We have try to fix it as much as possible and we may have “acceptable” with IDevices.

    I does not see the flick when I open your site on my Ipad (ios 6.xx).
    Do you see it all the time or just randomize?

    Regards

    activha Friend
    #490345

    Hello

    K2 version 2.6.6 removed support to variable K2SitePath which makes that the fix that you made earlier fails now (see http://activ-ha.com/activations )

    Could you tell me how to fix it ?

    Thanks

    Wall Crasher Developer
    #490638

    Hi activha,

    You should be careful when upgrade K2. Not all new K2 functions can be compatible with JA Wall.

    Though, K2 has just move the K2SitePath variable, you need to copy those script and placed it just before the block code you have copy before.

    // Generic function to get URL params passed in .js script include
    function getUrlParams(targetScript, varName) {
    var scripts = document.getElementsByTagName('script');
    var scriptCount = scripts.length;
    for (var a = 0; a < scriptCount; a++) {
    var scriptSrc = scripts[a].src;
    if (scriptSrc.indexOf(targetScript) >= 0) {
    varName = varName.replace(/[[]/, "\[").replace(/[]]/, "\]");
    var re = new RegExp("[\?&]" + varName + "=([^&#]*)");
    var parsedVariables = re.exec(scriptSrc);
    if (parsedVariables !== null) {
    return parsedVariables[1];
    }
    }
    }
    }

    // Set the site root path
    var K2SitePath = getUrlParams('k2.js', 'sitepath');

    Hope it helps.

    Regards

    activha Friend
    #490673

    Thanks, I also found that just removing the K2SitePath+ from the code you proposed works fine also.

Viewing 15 posts - 1 through 15 (of 15 total)

This topic contains 15 replies, has 3 voices, and was last updated by  activha 11 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum