Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20304 Bug fixes to Alphabetize options #11045

Merged
merged 6 commits into from
Oct 10, 2017
Merged

Conversation

mepps
Copy link
Contributor

@mepps mepps commented Sep 29, 2017

This builds on yashodha's PR: #10018 and just resolves two bugs.


@@ -157,7 +157,7 @@
{/literal}

<div class="action-link">
{crmButton q="reset=1&action=map&fid=$fid&gid=$gid" class="action-item" icon="sort-alpha-asc"}{ts}Alphabetize Options{/ts}{/crmButton}
{crmButton q="reset=1&action=map&fid=$fid&gid=$gid" class="action-item no-open" icon="sort-alpha-asc"}{ts}Alphabetize Options{/ts}{/crmButton}
Copy link
Member

Choose a reason for hiding this comment

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

There's already a class for this: no-popup so I don't think you need to create this new one.

Copy link
Contributor Author

@mepps mepps Sep 30, 2017

Choose a reason for hiding this comment

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

@colemanw I tried using that class, but if I click Alphabetize in a popup window it redirects to the page version. This may be a bug with that class but adding in this new class which is only excluded in the one line below and not in both places exclude is used was the only way I could get around that bug.

js/crm.ajax.js Outdated
@@ -498,7 +498,7 @@
settings = $el.data('popup-settings') || {},
formData = false;
settings.dialog = settings.dialog || {};
if (e.isDefaultPrevented() || !CRM.config.ajaxPopupsEnabled || !url || $el.is(exclude)) {
if (e.isDefaultPrevented() || !CRM.config.ajaxPopupsEnabled || !url || $el.is(exclude + ', .no-open')) {
Copy link
Member

Choose a reason for hiding this comment

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

This should not be necessary per my other comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we want to use no-popup above, we should remove it from the exclude array and instead explicitly exclude it here like I'm doing with no-open. I didn't want to do this since it's used in many places in the code base but in my randomized testing just now it did not seem to be used to close an existing pop up window in the code base (which is what it does in the other place exclude is used).

@mepps
Copy link
Contributor Author

mepps commented Oct 4, 2017

@colemanw Please note my response to your requested changes. Thanks for the review!

yashodha and others added 6 commits October 8, 2017 23:32
open-inline implies that it will not pop up, so this explicitly excludes them.
This allows us to fix the problem where clicking the sort button would add to the history of the popup and take you "back" when clicking done instead of simply closing the dialog.
@colemanw
Copy link
Member

colemanw commented Oct 9, 2017

@mepps I looked closer and decided to kill 2 birds with 1 stone by reusing the open-inline-noreturn class for this purpose. That also fixes the problem with the "Done" button not working the first time you click it.

@colemanw
Copy link
Member

@mepps if you can verify my changes then this will be good to go.

@yashodha
Copy link
Contributor

@colemanw works fine

@colemanw colemanw merged commit 9a26578 into civicrm:master Oct 10, 2017
@mepps
Copy link
Contributor Author

mepps commented Oct 10, 2017

Looks good to me, @colemanw. Thanks!

@mepps mepps deleted the CRM-20304 branch September 17, 2019 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants