-
AuthorPosts
-
activha Friend
activha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
February 2, 2013 at 8:59 pm #184620When 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 ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
February 4, 2013 at 9:37 am #482325Hello 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 Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
February 4, 2013 at 12:38 pm #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 registeredLuna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
February 5, 2013 at 9:15 am #482478Hello,
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 Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
February 5, 2013 at 10:18 pm #482599The 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 DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
February 6, 2013 at 8:28 am #482649Hi 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 226You should use one of these two options.
Hope it helps.
Regards
1 user says Thank You to Wall Crasher for this useful post
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
February 6, 2013 at 9:03 pm #482739Well 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 Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
February 14, 2013 at 5:09 pm #483460Well 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 DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
February 15, 2013 at 7:59 am #483529Hi 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.
Regards1 user says Thank You to Wall Crasher for this useful post
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
February 15, 2013 at 12:52 pm #483560Well I’m on iPad now and the fix works ok.
Will test further on desktop and android browsersThanks already 🙂
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
February 21, 2013 at 8:21 pm #484180Well 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 DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
February 25, 2013 at 3:22 am #484344Hi 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 Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
April 18, 2013 at 5:49 pm #490345Hello
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 DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
April 22, 2013 at 6:33 am #490638Hi 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
-
AuthorPosts
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