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

Fixed favorite deletion to not handle the form submission as a login … #751

Merged
merged 1 commit into from Jul 11, 2016

Conversation

EreMaijala
Copy link
Contributor

…event.

Deleting favorites refreshed the page only because the lightbox thought it was a login event. While I'd like to have a more robust mechanism for detecting login form submission, this change prevents MyResearch/Delete action from being handled as a login event. Subsequently a page refresh is required after deletion, so I moved the refreshPage method to VuFind common, used it in the deletion form and made the lightbox also use it.

I also moved the h2 of the delete screen to a more proper place before the form. While this doesn't make a difference in bootstrap3 or bootprint3, it's in line with other pages and makes it easier to customize in CSS how headings are displayed in the lightbox.

@@ -154,7 +139,7 @@ VuFind.register('lightbox', function Lightbox() {
}
if ( // Close the lightbox after deliberate login
obj.method // is a form
&& ((obj.url.match(/MyResearch/) && !obj.url.match(/Bulk/)) // that matches login/create account
&& ((obj.url.match(/MyResearch/) && !obj.url.match(/Bulk/) && !obj.url.match(/Delete/)) // that matches login/create account
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this new refresh-on-close method mean we can eliminate these hard-coded checks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, those are still needed for the login event to fire, and if you'd like to get rid of the automatic refresh on login, any login form displayed in the lightbox would need to have data-lightbox-close="VuFind.refreshPage();" or something.

@crhallberg crhallberg merged commit fb5a77e into vufind-org:master Jul 11, 2016
@EreMaijala EreMaijala deleted the delete-fav-fix branch August 23, 2016 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants