Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

support for custom binders when calling ac.done #182

Closed
wants to merge 4 commits into from

Conversation

caridy
Copy link
Contributor

@caridy 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.

Isao Yagi and others added 4 commits April 23, 2012 17:08
@redonkulus
Copy link
Contributor

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

@isao
Copy link
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
@mridgway
Copy link
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?

@drewfish
Copy link
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.

@FabianFrank
Copy link
Contributor

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.

@drewfish
Copy link
Contributor

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants