Skip to:

Opened 8 years ago

Closed 7 years ago

Last modified 4 years ago

#4816 closed enhancement (fixed)

Add class to whats-new-form re-factor form var to use .closest - global/buddypress.js

Reported by: hnla Owned by: boonebgorges
Milestone: 1.8 Priority: normal
Severity: normal Version: 1.7
Component: Templates Keywords: has-patch needs-testing
Cc: hnla


This patch provides a class for the whats-new-form form on submission of new update via ajax.

A class added after submit and existing for the page view state after submit and before page re-fresh aids the developer in having a hook that represents the ajax action and allows styling based on this event.

Patch adds the class on submit & removes the class onfocus of the textarea.

Patch also clears up another instance of traversing the DOM tree using .parent().parent().parent() in favour of the less resource hungry and lighter object .closest() to find the submits parent form element - relates to older ticket:

These changes ought to be safe, class can be ignored and not effect established themes.

Attachments (2)

4816-01.patch (1.9 KB) - added by hnla 8 years ago.
Adds/removes 'submitted' class to update form - removes use of .parent()
4816-02.patch (1.9 KB) - added by hnla 8 years ago.
revised refreshed patch for indents

Download all attachments as: .zip

Change History (8)

8 years ago

Adds/removes 'submitted' class to update form - removes use of .parent()

#1 @DJPaul
8 years ago

  • Keywords needs-refresh added; has-patch removed
  • Milestone changed from Awaiting Review to Future Release

Patch needs refreshing to make the indentation consistent, and we'll put it in the next next release so we have time to double-check the javascript change.

8 years ago

revised refreshed patch for indents

#2 @hnla
7 years ago

Bumping this for inclusion into 1.8 milestone.

#3 @boonebgorges
7 years ago

  • Keywords has-patch needs-testing added; needs-refresh removed
  • Milestone changed from Future Release to 1.8

#4 @boonebgorges
7 years ago

In 7161:

Toggle 'submitted' class on whats-new-form when posting activity items

This new class will make nice styling effects easier to build into child

See #4816

Props hnla

#5 @boonebgorges
7 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7162:

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

#6 @DJPaul
4 years ago

  • Component changed from Appearance - Template Parts to Templates
Note: See TracTickets for help on using tickets.