doabit / semantic-ui-sass

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

UI javascript not working #15

Closed dmautz1 closed 10 years ago

dmautz1 commented 10 years ago

None of the UI js is working despite when view source all of it is included. I get no errors in console either. All of the CSS works just fine.

I'm trying the example for tabbed menu found here http://semantic-ui.com/introduction/overview.html

<div class="ui pointing secondary demo menu">
  <a class="active red item" data-tab="first">First</a>
  <a class="blue item" data-tab="second">Second</a>
  <a class="green item" data-tab="third">Third</a>
</div>
<div class="ui active tab segment" data-tab="first">First</div>
<div class="ui tab segment" data-tab="second">Second</div>
<div class="ui tab segment" data-tab="third">Third</div>

Here's my gemfile:

gem 'rails', '4.1.1'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'therubyracer',  platforms: :ruby
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'state_machine'
gem 'semantic-ui-sass', '~> 0.16.1.0'
gem 'google-webfonts-rails'
gem 'unicorn'

application.js:

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
// Loads all Semantic javascripts
//= require semantic-ui

application.css.scss:

@import "semantic-ui";

I'm guessing I'm just doing something stupidly wrong.

dmautz1 commented 10 years ago

I updated application.js with a different order with no success:

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require semantic-ui
//= require_tree .
dmautz1 commented 10 years ago

Apparently the documentation for Semantic isn't very complete. For the tabs, I found that you have to have an additional jquery plugin: http://www.asual.com/jquery/address/

You also have to initialize the tabs individually: $('#menu .item').tab();

None of this was in any documentation. The only place I found any mention is in this issue: https://github.com/nd0ut/semantic-ui-rails/issues/12

Semantic is very cool but not complete enough. I don't have this amount of time to spend getting things working. I'll be using bootstrap until it is more ready.