Comments (9)
To reproduce this bug one must look at the server-side rendering of a page. The client-side rendering (with view) works ok. Compare:
http://127.0.0.1:4567/indie-web-camp
http://127.0.0.1:4567/view/indie-web-camp
It has been a bit of a struggle to keep these two versions in sync.
from smallest-federated-wiki.
I'm still wanting to employ delegate() but have to reorganize the code a bit to make it work when internal links add new pages client-side.
from smallest-federated-wiki.
All events within a delegate container -- be they from new links or not -- bubble to the container and will be processed.
Therefore this is a code-ectomy, no server-side code required at all. This is as it should be, localizing client-side hover highlighting in the client.
Other upside: one $.delegate() call will handle hover events on potentially hundreds of action links, including those actions added later.
It's all-good.
from smallest-federated-wiki.
$(".journal").delegate(".action", "hover", ...
I hate to be dense. And I could just try this, but ...
It seems to me that this creates delegates for all the .journals in existence when the statement runs. If more .journals are created then delegate() will have to run again to pick them up. This could happen when sortable gets set up as it is a similar workflow.
This is made more confusing in that the "view" url routing is just a work-around for code that hadn't been written when you offered this commit.
from smallest-federated-wiki.
Ah, I wasn't aware this was a requirement.
Events bubble-up through the DOM so, at the limit, we could use $("body").delegate( ".action", "hover", .... )
Of course this won't be as efficient as selecting a more specific parent container but that's our catch-all.
If journals are smart, as I suspect they eventually will, then we could make them wire themselves, with something like $( this ).delegate( ".action", "hover", .... )
upon creation, or have a potential journal factory do it.
from smallest-federated-wiki.
I like the $("body") idea. I'm not opposed to having the dom work hard for us. In fact, since this is a global operation, that seems to be the right place to delegate from. If you revise it and check out all these cases, I'll pull it gladly. I'm also happy to do it too.
from smallest-federated-wiki.
resolved by be2e970
from smallest-federated-wiki.
I like the $("body") idea
FWIW, I believe $(document.body)
is a little faster (a quick comparison confirms this - though it's barely significant).
resolved by be2e970
That commit is currently 404; did you perhaps forget to push?
from smallest-federated-wiki.
I attached the delegation to .main, the div around the pages.
(I thought it interesting that I could refer to a commit that I hadn't yet pushed. This simplified my workflow. However, there are drawbacks I hadn't considered. Might be time for a two-phase commit?)
from smallest-federated-wiki.
Related Issues (20)
- I've made a 'Deploy to Heroku' button HOT 1
- Journal Data Missing HOT 5
- Support for other languages HOT 1
- Unexpected Network Changed Error HOT 6
- An easy offline read-only version of a fed wiki site? HOT 2
- Documentation of plugin available while editing HOT 2
- Close a column HOT 3
- Story Data Missing, Journal Data Preserved HOT 5
- Pages Named "Clear" Cause Weird Behavior HOT 5
- Help. What frequent questions should our FAQ answer? HOT 3
- Is it possible to horizontally scroll with a trackpad? HOT 1
- Google OpenID claiming no longer working HOT 2
- Wiki Chrome Extension planning HOT 9
- TypeError: Can't find plugin for 'html' HOT 4
- Installation Guide outdated ? HOT 1
- Provide a link to current discussion / issue tracker in Readme.md HOT 1
- Potential for federated wiki on sandstorm.io? HOT 13
- Directory 'Smallest-Federated-Wiki/server/express' doesn't exist HOT 1
- Stronglinks
- FedWiki on ChromeOS Version 64 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 smallest-federated-wiki.