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

Have AbstractChosen and SelectParser available from window #1814

Closed
wants to merge 1 commit into from
Closed

Have AbstractChosen and SelectParser available from window #1814

wants to merge 1 commit into from

Conversation

daniel-g
Copy link

@daniel-g daniel-g commented Mar 7, 2014

No description provided.

@tjschuck
Copy link
Member

tjschuck commented Mar 7, 2014

@daniel-g Please give some reason/justification for this pull request. Closing until more information provided.

@tjschuck tjschuck closed this Mar 7, 2014
@daniel-g
Copy link
Author

daniel-g commented Mar 7, 2014

Oh, sorry. I was getting the error 'AbstractChosen' not defined and 'SelectParser' not defined, so I fixed it assigning the class to the window namespace.

@stof
Copy link
Collaborator

stof commented Mar 7, 2014

well, are you using the compiled JS or are you compiling the CoffeeScript source yourselves ?

@daniel-g
Copy link
Author

daniel-g commented Mar 7, 2014

I'm using rails assets.

@stof
Copy link
Collaborator

stof commented Mar 7, 2014

well, the issue is that the CoffeeScript files have to be compiled together, not separately. AFAIK, the rails assets system loads them separately, which is why it fails.

Given that the chosen build process does not require leaking additional global variables, we don't want to add it for other build processes.
See #1455 for a similar report btw

@daniel-g
Copy link
Author

daniel-g commented Mar 7, 2014

I'm using bower to install the dependencies, so I have separate files. Should I use the distributed js and check the dependencies myself? If that's the case, I prefer just using my fork :).

@tjschuck
Copy link
Member

tjschuck commented Mar 7, 2014

Chosen does not support command-line bower install chosen installation. This is because the repo does not contain the compiled sources, and bower does not currently support adding a build step.

You can specify that you'd like to use the release ZIP file in your own project's bower.json file, like:

{
  "name": "my-project",
  "version": "1.0.0",
  "dependencies": {
    "jquery": "1.10.2",
    "chosen": "https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip"
  }
}

See #1509, #1472, #1333, and #1316 for more info.

@daniel-g
Copy link
Author

daniel-g commented Mar 7, 2014

That fixed the problem, thanks.

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

Successfully merging this pull request may close these issues.

3 participants