Closed (fixed)
Project:
Activity
Version:
6.x-1.1
Component:
Activity Contrib
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Apr 2009 at 07:32 UTC
Updated:
6 May 2009 at 21:20 UTC
Hi,
I hope that's the good place to post this.
I've change a little bit the activity_comment.js file to make a better use of JQuery effects.
My aim was to make the comment box appear in a slide when clicking on 'comments' and disappear the same way when clicking again.
Here is the simple code :
Drupal.behaviors.activityComments = function(context) {
$('.activity-comments-click-to-show').toggle(
function() {
$(this).parent().siblings('.activity-comments-form-hidden').slideDown("fast");
},
function() {
$(this).parent().siblings('.activity-comments-form-hidden').slideUp("fast");
}
);
};I believe it's greater like this, what about you?
Comments
Comment #1
sirkitree commentedCan you explain why this is any better? .slideToggle() does in one line what yours is doing in 6. Is it any faster performance-wise?
Comment #2
Pierre_G commentedWell, sorry about this, I didn't know about slideToggle.
This part of the original JS file :
toggleClass('activity-comments-form-shown');could so be replaced by :
slideToggle("fast");The point is that it's more beautiful with some slide than with a toggleClass, no?
Comment #3
jaydub commented@Pierre_G actually the JS was changed in -dev already to use slideToggle but since you are looking at 6.1.1 you would not have seen that. There are a few more things to test out and/or add in before making a 6.1.2 release but for now you should feel confident in taking a look at a -dev snapshot for updated functionality.
Comment #4
jaydub commentedComment #5
sirkitree commentedOh, I'm sorry. You have this marked as version 6.x-1-1 and I was looking at what we have in 6.x-1.x-dev which is where we have the .slideToggle('fast') going on, and yes, it is much more beautiful. Take a look, I think it accomplishes the same effect you are talking about:
Please try this out and let me know if it is giving you the desired result.
Comment #6
Pierre_G commentedOk, that's perfect in the js file of 6.x-1.x-dev.
The only thing is that the js file is not included in my page !! So it doesn't work... (click on 'comment' = no effect)
Same issue in the activity page or in a block anywhere else.
Am I the only one with that issue or is it something normal in the dev snapshot ?
Comment #7
sirkitree commentedThis is loaded in the theme function theme_activity() - so as long as you have the required permission: 'create activity comment' - the file should be loading.
Comment #8
sirkitree commentedOh, duh. typo - that should be 'create activity comments' - with an s. fixed in CVS.
Comment #9
sirkitree commented