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

Error when uninstalling last script #2957

Closed
arantius opened this issue May 18, 2018 · 5 comments
Closed

Error when uninstalling last script #2957

arantius opened this issue May 18, 2018 · 5 comments
Milestone

Comments

@arantius
Copy link
Collaborator

If you have only one script installed and you uninstall it (specifically, I click "uninstall" then when clicking the back arrow) you get:

 e is not a function rivets.bundled.min.js:6

A failure somewhere in the rivets templating engine. A second click on the back button works.

@arantius arantius added this to the 4.5 milestone May 18, 2018
@arantius
Copy link
Collaborator Author

Update: this is "last script in a section". So if you have only one "for this tab" or "other", this happens.

@Sxderp
Copy link
Contributor

Sxderp commented May 29, 2018

This has to do with using rv-unless for the script sections.

<div rv-unless="userScripts.active | empty">
<heading>{'user_scripts_for_this_tab'|i18n}</heading>

<div rv-unless="userScripts.inactive | empty">
<hr rv-unless="userScripts.active | empty">
<heading>{'other_user_scripts'|i18n}</heading>

Changing the top <div>s to rv-hide solves the problem.

@arantius
Copy link
Collaborator Author

I'd prefer the behavior of unless (unneeded elements are not in the DOM at all, vs. hidden via CSS). Do you know why? Unless/if should work, shouldn't they?

@Sxderp
Copy link
Contributor

Sxderp commented May 29, 2018

I'm not entirely sure, but this and #2963 might be related to the following:
mikeric/rivets#452 (comment)

I haven't done any testing (related to why rv-if fails) and I only just now looked up the above issue (doing a search on rv-if problems). I only thought of changing the directive because I distinctly remember this working in some mockups (never published) some time ago.

@arantius
Copy link
Collaborator Author

That sure looks like a good explanation.

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

No branches or pull requests

2 participants