johnny / jquery-sortable

A flexible, opinionated sorting plugin for jQuery
http://johnny.github.io/jquery-sortable/
Other
1.52k stars 441 forks source link

Hard dependency on bootstrap? #193

Closed rpbaltazar closed 9 years ago

rpbaltazar commented 9 years ago

On the current project I don't use bootstrap. I'm using something that is requiring this plugin. Does it make sense that it is hardly dependent on bootstrap?

johnny commented 9 years ago

This plugin does not depend on bootstrap. You can easily roll your own styles.

rpbaltazar commented 9 years ago

https://github.com/johnny/jquery-sortable/blob/master/source/css/_base.sass Do I have to override this file then?

wkurosawa commented 8 years ago

@johnny @rpbaltazar I'm having issues with this file too, since my project doesn't have bootstrap. I have a Rails app with Medium Editor + Medium Editor Insert Plugin that requires jquery-sortable and I have installed jquery-sortable with bower.

Rails compile css and js files.. Then it throws errors, first because of bootstrap that I don't have, and after removing _base.sass references it show errors because of un-initialized variables $linkColor $grayLighter $grayLight $grayDark

Is it supposed to boostratp file to have this variables?

frahugo commented 8 years ago

There seems to indeed be a dependency on Bootstrap:

Undefined variable: "$linkColor"
emaiax commented 8 years ago

yeah, it seems to be impossible to run without bootstrap.

anyone made it? 😕

kleberpinel commented 8 years ago

any update on it ? I'm still getting the same problem.

wkurosawa commented 8 years ago

It really looks that is tied to some bootstrap variables/files.

The only workaround that worked for me was editing _base.sass, commenting boostrap import and setting those un-initialized variables.

// @import bootstrap
$linkColor: blue
$grayLighter: gray
$grayLight: gray
$grayDark: gray

Commenting references to $iconWhiteSpritePath variable.

And also editing application.js to reference bootstrap files already included on vendor folder

//= require "./vendor/jquery"
//= require "./vendor/jquery.color"
//= require "./vendor/bootstrap-switch"
//= require "./vendor/bootstrap-scrollspy"
//= require "./vendor/bootstrap-dropdown"
//= require "./vendor/bootstrap-button"

Not the best solution I guess, but it allowed me to keep using it.

j15e commented 7 years ago

It is also causing production asset compilation failure when used with bower-rails since it auto-include & compile that application.css, unless you rake bower:clean.

rpbaltazar commented 7 years ago

Given that this repo seems to be kinda dead, the best solution so far is @wkurosawa's I guess.

garshyn commented 7 years ago

I found out that it crashes, because rails' sprockets tries to compile application.[sass, js] files and doesn't find bootstrap file. pretty annoying as the plugin doesn't have that dependency. Is it possible to exclude this compilation?

rake bower:clean doesn't work for me, because it removes important files from other libraries. It is possible to fix it by creating bootstrap file (and other dependencies) in vendor/javascripts folder.

But personally I chose to remove the dependency from Bowerfile and include jquery-sortable.js into the repo.

krongk commented 7 years ago

is there any solution?