Skip to:
Content
Pages
Categories
Search
Top
Bottom

Where's the javascript that expands whats-new-content?

  • @number_6

    Participant

    Hi,

    When one clicks on the input field on the activity box, it expands. This is really annoying when adding extra forms to the div. I’ve been asking on and off for years how to rid my buddypress of it, and I get no help. I once got around it by fixing the height of the div, but that’s a limited solution. I need to find the javascript that’s responsible and purge it!

    Anyone know anything of this feature?

Viewing 7 replies - 1 through 7 (of 7 total)
  • @henrywright

    Moderator

    @number_6

    Participant

    Hey @henrywright

    That did appear to be it, but it must also exist in another js file. I’m not very familiar with BP’s theme structure, but isn’t the legacy folder referred to where other files don’t have a reference, or something like that?

    Thanks for the speedy response.

    @henrywright

    Moderator

    I think you’re right in that bp-legacy files are used when a file doesn’t exist in your templates folder. In this case though I’m not sure the same applies as it’s a .js file. Perhaps @danbp will know what happens in this instance?

    Update: After a little research, it seems as though the same does apply to .js files. See here which loosely mentions .js files

    * As of BP 1.8 the paths for assets i.e styles and JS has been modified to look to your ‘buddypress’ or ‘community’ folders first…

    So you’re right to think the JavaScript that expands the what’s new textarea on focus may exist elsewhere. But unless you’ve explicitly created the file in your theme, then bp-templates/bp-legacy/js/buddypress.js should be the only place.

    @danbp

    Participant

    @henrywright is right. There is only one js file handling whats-new: buddypress.js and one function: bp_activity_action_post_update() in bp-activity-actions.php:289 (2.2) and of course CSS, in buddypress.css

    Thought you have to use the minified versions to get customization to work.
    buddypress.min.js
    buddypress.min.css

    @number_6

    Participant

    Thanks for the exchange, @danbp and @henrywright
    Maybe I’ve driven myself to exhaustion, but I’m finding it hard to make use of the information danbp provided.

    @sbrajesh

    Participant

    Hi @number_6,
    Just wanted to post that it is easily doable with a small snippet of js.

    Please put this code in your js file.

    
    jQuery('#whats-new').off('focus');
    jQuery('#whats-new').off('blur');
    

    Please put this inside the document ready section for your theme’s js file( or please do let me know if you want me to provide the complete code).

    By putting the above code, we have turned off the focus/blur events bound with the activity post box. So, There won’t be any fluctuation.

    Now, we will need some css to make the activity box and the post button visible properly.

    Here is the css code.

    
    #whats-new-options{
    height: 40px !important; /** I have used important to make sure that it will always be effective*/
    }
    
    form#whats-new-form textarea{
    height: 50px !important;
    }
    
    

    hoping that the above code works for you. Please do post back it it works for you or not?

    @number_6

    Participant

    @sbrajesh Sorry for the delay.

    That works perfectly. Although I have to let you know that I specified with CSS that the form should be a fixed height, already (patch up job), so that may effect those two lines you gave me.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Where's the javascript that expands whats-new-content?’ is closed to new replies.
Skip to toolbar