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

Depricate Switcher, Merge functionality to container. #70

Closed
Iheartweb opened this issue Apr 6, 2012 · 2 comments
Closed

Depricate Switcher, Merge functionality to container. #70

Iheartweb opened this issue Apr 6, 2012 · 2 comments
Assignees

Comments

@Iheartweb
Copy link
Member

No description provided.

@Iheartweb
Copy link
Member Author

@Jimgskoop I am starting to heavily consider folding Loader into Container as well. The reason is this.

Lets say you have a carousel with 5 items. In this Carousel the first two items have static content and are stateful - SO, they should be managed by Container.

But what if the remaining items have dynamic content? - This should obviously be managed by Loader. But, does this also mean that we have two separate client-side templates for Container and Loader? They would be virtually identical.

I'd rather do something like this:

{#items}
{@if cond="{idx} < 3}
 {>item content="Lorem Ipsum"}
 {else}
 {>item uri="http://www.google.com#node"}
 {/else}
{/if}
{/items}

Where item has a config that looks something like:

{
  'Container': {
    {?url}'url': {url} {/url}
    {?content}'content': {content} {/content}
  }
}

We could do the same type of logic and still keep Loader and container separate but it gets nasty:

{
  {?url}'Loader'{url} {/url} {?content}'Container'{content} {/content}: {
    {?url}'url': {url} {/url}
    {?content}'content': {content} {/content}
}

What if both url and content are defined? -- You'd have to introduce more logic into the template to make sure that's not the case. - This is better done in the control.

@Jimgskoop
Copy link
Contributor

That sounds OK to me. Container already knows how to source content
from elsewhere in the DOM; Loader just adds on the XHR and iframe
smarts.

My thinking was that any URL supercedes any local source if both are
present, but admittedly that's not ideal.

The only caveat is that you'll probably need distinct config params
for string, node, and URL for the source, in case you want to do
something like inject a URL as a string to display.

-Jim G

On Apr 14, 2012, at 11:14 AM, Robert Martone <reply@reply.github.com

wrote:

@Jimgskoop I am starting to heavily consider folding Loader into
Container as well. The reason is this.

Lets say you have a carousel with 5 items. In this Carousel the
first two items have static content and are stateful - SO, they
should be managed by Container.

But what if the remaining items have dynamic content? - This should
obviously be managed by Loader. But, does this also mean that we
have two separate client-side templates for Container and Loader?
They would be virtually identical.

I'd rather do something like this:

{#items}
{@if cond="{idx} < 3}
{>item content="Lorem Ipsum"}
{else}
{>item uri="http://www.google.com#node"}
{/else}
{/if}
{/items}

Where item has a config that looks something like:

{
 'Container': {
   {?url}'url': {url} {/url}
   {?content}'content': {content} {/content}
 }
}

We could do the same type of logic and still keep Loader and
container separate but it gets nasty:

{
 {?url}'Loader'{url} {/url} {?content}'Container'{content} {/ 
content}: {
   {?url}'url': {url} {/url}
   {?content}'content': {content} {/content}
}

What if both url and content are defined? -- You'd have to introduce
more logic into the template to make sure that's not the case. -
This is better done in the control.


Reply to this email directly or view it on GitHub:
https://github.com/Iheartweb/Lu/issues/70#issuecomment-5133289

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