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

FIX Don't require jquery on the frontend #2854

Merged

Conversation

GuySartorelli
Copy link
Member

None of this javascript is actually used in the built-in silverstripe navigator functionality anymore - but someone might be relying on this javascript being there, so just removing the file would be a breaking change. Instead, I've rewritten the jquery functionality using pure javascript.

You can test it using this in a template. The new js should behave the same way the old js did in 4.11. Note that the popup css puts the popup above the visible area of the window by default, so I've added an !important style to the element below to counteract this for testing purposes.

$SilverStripeNavigator

<div id="SilverStripeNavigatorLink">
    <a>This is a link thing apparently?</a>
</div>
<div id="SilverStripeNavigatorLinkPopup" style="top:0!important;">
    This is the popup! It'll pop up.
    <a class="close">close</a>
    <br>
    <input value="this test will be selected when you click the input">
</div>

Issue

Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

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

Tested locally, seems fine

@emteknetnz emteknetnz merged commit 55eabd6 into silverstripe:4.12 May 8, 2023
@emteknetnz emteknetnz deleted the pulls/4.12/fix-ss-navigator branch May 8, 2023 00:53
@emteknetnz
Copy link
Member

Released as 4.12.2 and 4.13.1

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