Coder Social home page Coder Social logo

Comments (7)

tsechingho avatar tsechingho commented on July 28, 2024

If you look up 720c86b, you will see Chosen change it's container html and use js to add/remove tag class chzn-with-drop of container.

In my local box, I don't have your situation without ActiveAdmin. Maybe you can check if chzn-with-drop exists?

from chosen-rails.

nicosantangelo avatar nicosantangelo commented on July 28, 2024

I didn't see that commit, I was checking against a working version to see what changed, my bad.

Having that in mind I looked at the code and the implementation was adding the chosen.css file with @import chosen in active_admin.css.scss so I deleted that and added the *= require chosen but it didn't fix yet (but at least now it's added properly).

The chzn-with-drop class is setted correctly

<div id="q_user_id_chzn" class="chzn-container chzn-container-multi chzn-with-drop chzn-container-active" style="width: 240px;" title="">
    <ul class="chzn-choices">
    ....

Do you know if some online demo is already using this version? (so I can see a working version and really check if it is activeadmin what causes the problem)

from chosen-rails.

wdiechmann avatar wdiechmann commented on July 28, 2024

hmmm - I experience somewhat the same!

In production:
skrmbillede 2013-06-21 kl 11 47 41

in development:
skrmbillede 2013-06-21 kl 11 47 51

any leads?

from chosen-rails.

wdiechmann avatar wdiechmann commented on July 28, 2024

I should add that I'm on chosen-rails 0.9.15 (bundle updated today) and running Ruby 1.9.3 with Rails 3.2.8 on top

from chosen-rails.

tsechingho avatar tsechingho commented on July 28, 2024

@wdiechmann Do you add width option in javascript, as discussed in #26 ?

from chosen-rails.

wdiechmann avatar wdiechmann commented on July 28, 2024

I use it just as prescribed :) Complete with

allow_single_deselect: true no_results_text: 'No results matched' width: '200px'

I can't be 100% sure - but I'am pretty sure this thing worked (in production too) back in 0.9.8'ish

ohh - and I use it with simple_form

  • and I've checked the js console (no errors not even a missing resource or anything even close - what'a'you'know; gotta' get lucky once in a while ;) )

the resulting HTML looks like this:

<fieldset class="control-group select optional">
    <div class="controls">
        <label class="select optional " data-content="sprog" data-placement="top" for="employee_person_attributes_language_id" rel="popover">sprog</label>
        <select class="select optional chzn-select chzn-done" id="employee_person_attributes_language_id" name="employee[person_attributes][language_id]" style="display: none;">
            <option value="">vælg sproget</option>
            <option value="13">dansk</option>
            <option value="14">deutch</option>
            <option value="15">italiano</option>
        </select>
        <div id="employee_person_attributes_language_id_chzn" class="chzn-container chzn-container-single" style="width: 250px;" title="">
            <a href="javascript:void(0)" class="chzn-single" tabindex="-1">
                <span>vælg sproget</span>
                <div><b></b></div>
            </a>
            <div class="chzn-drop" style="left:-9000px;">
                <div class="chzn-search">
                    <input type="text" autocomplete="off">
                </div>
                <ul class="chzn-results">
                    <li id="employee_person_attributes_language_id_chzn_o_0" class="active-result result-selected" style="">vælg sproget</li>
                    <li id="employee_person_attributes_language_id_chzn_o_1" class="active-result" style="">dansk</li>
                    <li id="employee_person_attributes_language_id_chzn_o_2" class="active-result" style="">deutch</li>
                    <li id="employee_person_attributes_language_id_chzn_o_3" class="active-result" style="">italiano</li>
                </ul>
            </div>
        </div>
    </div>
</fieldset>

from chosen-rails.

wdiechmann avatar wdiechmann commented on July 28, 2024

not sure whether this is any help to you @nicosantangelo - but when I compared the resources between my development and production I discovered that the chosen.css did not get compiled into the resource!

So - I went hunting and discovered that my application.css had this:

 *= require_self
 *= require chosen

at the top - and about half-way through this:

/*
 * some comments and styles commented

*but no / at the end!

Lesson learned! Always keep comments in pairs!

Even if you're gonna comment the rest of the file

from chosen-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.