Comments (5)
I no longer have my code as I reverted my changes. But here was my use case. I was using render_async on my sidebar menu which has a list of menu items where a user can add/remove more menu items. The reason I use render_async so if the menus are toggled, I can refresh the sidebar without having to reload the page.
The sidebar however has javascript onHover that changes the width of the sidebar (Icons -> Icons with Text). CSS onhover can be used but I find a better implementation with JS and using HoverIntent
from render_async.
Also mention in passing any other options like
container_id: "sidebarRefresh" , html_element_name: 'ul', container_class: 'nav nav-tabs nav-stacked'
is also ignored
from render_async.
Hey, thanks for opening an issue.
This is an interesting problem. I am interested, are you using render_async
with jQuery or with Vanilla JS? Here's how you can configure different options, just in case
from render_async.
But I think regardless of what you use, you are right:
Upon investigation, the code seems to only printing out the cached HTML.
I'd like to understand your use case, why do you need the JS portion of the gem if you're caching it? Are you expected to do some JS logic on every render?
from render_async.
Got it, thanks for sharing what you did. I'm glad you managed to make it work 🙌
But the issue you raised here is still valid - whether we should enable performing of cached JS response in render_async 🤔 If anyone has an idea on how to do it, please share below
from render_async.
Related Issues (20)
- preventDefault() in toggle code interferes with other UI functionality HOT 2
- Feature idea: Render async with ActiveJob & ActionCable HOT 2
- Render_async on header HOT 2
- Duplication of injected JS for nested async templates HOT 1
- Start polling immediately option when toggle is specified HOT 1
- Manual retry based on JS event HOT 3
- Idea: only fire the AJAX request on scroll (Lazy Partials) HOT 1
- Event driven reloads. HOT 3
- Polling: vanilla js has code that runs before document has finished loading HOT 2
- Feature request: Refresh with event HOT 5
- Feature: Append or prepend content on toggle HOT 1
- Content flashes on page revisit even with Turbolinks enabled HOT 6
- render_async issues with container_id and turbolinks : not reloading or JS not firing on new visit depending on configuration HOT 5
- Add Support for Turbo HOT 3
- Add delay before performing async call HOT 4
- content_for :render_async does nothing. HOT 1
- Turbo: Toggable selector not executing the event_listener function set by _setUpToggle on a new visit HOT 1
- JS scripts not loading synchronously HOT 2
- How to update url params when refreshing the partial. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from render_async.