doabit / semantic-ui-sass

Semantic UI, converted to Sass and ready to drop into Rails & Compass.
MIT License
1.15k stars 190 forks source link

$(...).sidebar is not a function #122

Closed Guillaumejfrt closed 6 years ago

Guillaumejfrt commented 6 years ago

Hi,

I've been using gem semantic-ui-sass for several months and my sidebar has always toggled perfectly. However, it doesn't work anymore. JS in the console says $(...).sidebar is not a function. I don't understand is going wrong. Here is my code in my js file:

$("#ui-sidebar").sidebar("attach events", ".sidebar-item");

Could you help me?

Thanks

doabit commented 6 years ago

image I tested and it seems work, could you paste your sample code?

Guillaumejfrt commented 6 years ago

Yes the the selector $("#ui-sidebar") do work. It's the semantic function .sidebar() which is not working.

I am not sure to understand which part of my code you want to see. Do you want me to send the html part?

doabit commented 6 years ago

This is my javascript code:

//= require rails-ujs
//= require turbolinks
//= require jquery
//= require semantic-ui

and this is html

<div id="ui-sidebar">
  <div class="sidebar-item">demo</div>
</div>
Guillaumejfrt commented 6 years ago

yes I have the same:

//= require jquery //= require jquery_ujs //= require semantic-ui //= require_tree ./channels //= require_tree .

and

Le mer. 22 nov. 2017 à 11:31, Sean Deng notifications@github.com a écrit :

This is my javascript code:

//= require rails-ujs//= require turbolinks//= require jquery//= require semantic-ui

and this is html

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/doabit/semantic-ui-sass/issues/122#issuecomment-346309785, or mute the thread https://github.com/notifications/unsubscribe-auth/AXGT79Lp-fia7aZXPwtNOMRHo_EV5QFWks5s4_gVgaJpZM4QnB3U .

doabit commented 6 years ago

Please paste your layout code, and where the $("#ui-sidebar").sidebar("attach events", ".sidebar-item"); code you put.