Skip to:
Content

BuddyPress.org

Changeset 7162


Ignore:
Timestamp:
06/05/2013 03:11:29 AM (11 years ago)
Author:
boonebgorges
Message:

Use jQuery.closest() to find form when submitting activity update

Using closest() instead of traversing with parent() makes the JS much more
flexible, as theme authors are free to change how elements are nested without
breaking the JS.

Fixes #4816

Props hnla

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-templates/bp-legacy/js/buddypress.js

    r7161 r7162  
    7171    jq("#aw-whats-new-submit").on( 'click', function() {
    7272        var button = jq(this);
    73         var form = button.parent().parent().parent().parent();
     73        var form = button.closest("form#whats-new-form");
    7474
    7575        form.children().each( function() {
  • trunk/bp-themes/bp-default/_inc/global.js

    r7161 r7162  
    7171    jq("input#aw-whats-new-submit").click( function() {
    7272        var button = jq(this);
    73         var form = button.parent().parent().parent().parent();
     73        var form = button.closest("form#whats-new-form");
    7474
    7575        form.children().each( function() {
Note: See TracChangeset for help on using the changeset viewer.