Skip to content

use label as a subject-identifier-type - #19

Open
MegaphoneJon wants to merge 1 commit into
twomice:masterfrom
MegaphoneJon:label-text
Open

use label as a subject-identifier-type#19
MegaphoneJon wants to merge 1 commit into
twomice:masterfrom
MegaphoneJon:label-text

Conversation

@MegaphoneJon

Copy link
Copy Markdown
Contributor

Since I have to unfork my version of the extension anyway, here's the only outstanding feature I have - use label as a subject identifier.

The main use case for this is to show hide the "Other Amount" when someone clicks the "Other" button. Since the "Other" element has a different ID on each page, this allows you to set the behavior once for all pages (especially future pages).

Comment thread js/profcond.js
} else if (typeof condition.selector != 'undefined') {
el = $(condition.selector);
} else if (typeof condition.label != 'undefined') {
condition.id = CRM.$("label:contains(" + condition.label + ")").attr('for');

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it could match more broadly than intended. E.g., if condition.label = 'Foo', this would match elements with label 'FooBar', 'BarFoo', etc. Any chance you could tighten this to be an exact match?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants