Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

support for custom binders when calling ac.done #182

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
6 participants
Collaborator

caridy commented Jun 2, 2012

having a structure like this at the mojit level:

/mojitName
   /binders/foo.js
   /binders/bar.js
   /views/index.mu.html
   /views/baz.mu.html

you can invoke ac.done in your action to customize which binder to use:

ac.done(data, { 
    view: {
        name: "index",
        binder: "foo"
    }
});

or more customization

ac.done(data, { 
    view: {
        name: "baz",
        binder: "bar"
    }
});

in general, if there is a file defining a binder, you can now attach it to any view.

Contributor

redonkulus commented Jun 24, 2012

+1 to this, as its sorely needed to serve different binders across different devices (mobile vs desktop). What is the status / ETA on this?

Contributor

isao commented Jul 3, 2012

👍 look great. ran it through the secondary tests (pull-job 23) but it got kicked out for jslint errors.

@ghost ghost assigned mridgway Aug 8, 2012

Collaborator

mridgway commented Aug 8, 2012

@drewfish Does the new resource store affect any of the code in this PR? I saw that the notes mentioned that it made this feature possible, so should this be re-implemented to make use of the new functionality in the RS?

Contributor

drewfish commented Aug 8, 2012

I think it should still work with the new resource store. The new store continues to set 'binder-url', 'binder-path', 'binder-module', 'binder-yui-sorted' in the mojit instance.

Contributor

FabianFrank commented Aug 12, 2012

When looking at @redonkulus use case, I think it would be good that when we have
index.js
index.iphone.js

Mojito automatically serves the index.iphone.js binder. People shouldn't have to implement this logic by themselves. We should have this kind of automatic file picking for devices across the framework, I think.

Contributor

drewfish commented Aug 13, 2012

@FabianFrank That's how Mojito works today. If you say ac.done(..., {view: {name: 'index'}}); it will use the index.iphone.js binder for iphone users.

What the original request wants is a way to use a binder that doesn't match the name of the action.

@caridy caridy closed this Sep 12, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment