Giter Club home page Giter Club logo

Comments (7)

ckirkendall avatar ckirkendall commented on July 28, 2024

Currently no, but after looking at it, I feel it would not be too difficult
to implement. I will take a look this weekend and get back with you.

CK

On Tue, Jan 8, 2013 at 1:39 PM, solussd [email protected] wrote:

Is there an equivalent to the "this-node" selector from enlive?


Reply to this email directly or view it on GitHubhttps://github.com//issues/39.

from enfocus.

solussd avatar solussd commented on July 28, 2024

Would the ":root" CSS3 selector be appropriate for this?

from enfocus.

ckirkendall avatar ckirkendall commented on July 28, 2024

Domina and I ware using dojo's css3 selector engine (bundeled with google
closure) under the covers. I do not think :root works. Can you post some
code and maybe I can give you some alternatives until we can implement
this-node selector.

On Thu, Jan 10, 2013 at 11:35 AM, solussd [email protected] wrote:

Would the ":root" CSS3 selector be appropriate for this?


Reply to this email directly or view it on GitHubhttps://github.com//issues/39#issuecomment-12105472.

from enfocus.

solussd avatar solussd commented on July 28, 2024

:root doesn't work, currently. I was wondering if it would make sense to make it work in lieu of this-node, but since you're using a third-party css selector engine that probably isn't practical.

I have a workaround, for now- I just know the id/class/element type of my root element and explicitly select it.

thanks!

from enfocus.

xavi avatar xavi commented on July 28, 2024

I also would like to be able to refer to "this-node" so that I could set one of its attributes with a value from the object corresponding to the current iteration. Something like...

[".review"]
(em/clone-for [review reviews]
  this-node (em/set-attr :data-id (:id review))

Right now the only workaround that I can think of is to add an extra div to wrap the .review element, and clone-for that wrapper, so that then it would be possible to refer to the contained .review to set its data-id attribute. Not elegant at all.

from enfocus.

ckirkendall avatar ckirkendall commented on July 28, 2024

@xavi @solussd I added this-node selector back on the 13 of Jan. If you guy could test with the current 1.0.0-SNAPSHOT that would be awsome. The this-node selector is in the enfocus.core namespace. I also added the ability to use xpath selectors that can be used in some of these edge cases. Below is a basic example of using the this-node selector.

(em/at node 
     ["#id"] (em/content ...)
     ef/this-node (em/set-attr :data-id (:id review))

CK

from enfocus.

xavi avatar xavi commented on July 28, 2024

Awesome response time.
I tested it with 1.0.0-SNAPSHOT, and yes, it works :)
Thank you very much!

from enfocus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.