A simple test
Jacob Farber
jacob.farber at utoronto.ca
Fri Aug 8 21:05:01 UTC 2008
Ok,
After throwing this example around, Antranig and Anastasia helped point
out a critical point:
when the modules and columns selectors are called they must **scope
nicely within the container. **
So...forgetting for a second the ID requirements of the layout
customizer, if I wanted to write minimalist code like :
<div id="container">
<div>
<h1>Column</h1>
<div>portlet</div>
<div>portlet</div>
<div>portlet</div>
</div>
<div>
<h1>Column</h1>
<div>portlet</div>
<div>portlet</div>
<div>portlet</div>
</div>
</div>
and then naturally gravitate to write this as the initialization code...
fluid.reorderLayout ("#container", {
columns: "#container > div",
modules: "#container > div > div"
});
.... this wont work because calling ("#container > div") as is scoped
within ("#container") will give you nothing, even though they should be
perfectly legal columns and modules to work with the component.
I spoke with Anastasia for a while about the purpose of scoping within
the internals of the layout customizer code, but I think we need to
reconsider how its done: instead of automatically scoping selectors to
within the container for all jQuery calls, why not simply allow the
implementor to use whatever selector pattern they prefer (allowing them
to use whatever markup they prefer) and THEN verify its a legal module
or column? Am I misunderstanding how the component works?
Just a thought.
Jacob
Jacob Farber wrote:
> Hi everyone,
> If you have a moment, could you please test this markup:
>
> <div id="sample" class="columnSetup">
> <div id="id_column_1" class="myColumn">
> <h2>Column A</h2>
> <div id="id_1" class="mySortable">Drag me! Content goes
> here...A</div>
> <div id="id_2" class="mySortable">Drag me! Content goes
> here...</div>
> <div id="id_3">Static Content</div>
> <div id="id_4">Static Content</div>
> </div>
> </div>
> </div>
>
> with these jQuery selectors:
> jQuery(".myColumn") and jQuery("columnSetup > div")
>
> ...and please let me know if they return different things. They should
> return the exact same things. I'm running into a scenario when the
> latter returns and error, and the former doesnt.
>
> Thanks
> Jacob
>
>
>
> _______________________________________________
> fluid-work mailing list
> fluid-work at fluidproject.org
> http://fluidproject.org/mailman/listinfo/fluid-work
>