less-rails-bootstrap 2.3.3 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/README.md +7 -11
- data/lib/less/rails/bootstrap/version.rb +1 -1
- data/scripts/update_bootstrap.sh +37 -8
- data/test/cases/usage_css_spec.rb +15 -12
- data/test/cases/usage_js_spec.rb +4 -4
- data/test/dummy_app/app/assets/stylesheets/fonts.css.less +2 -0
- data/test/dummy_app/app/assets/stylesheets/framework.css.less +4 -2
- data/test/dummy_app/app/assets/stylesheets/individual.css.less +2 -2
- data/test/spec_helper.rb +1 -2
- data/vendor/assets/javascripts/twitter/bootstrap.js +0 -1
- data/vendor/assets/javascripts/twitter/bootstrap/affix.js +58 -49
- data/vendor/assets/javascripts/twitter/bootstrap/alert.js +36 -37
- data/vendor/assets/javascripts/twitter/bootstrap/button.js +41 -39
- data/vendor/assets/javascripts/twitter/bootstrap/carousel.js +131 -125
- data/vendor/assets/javascripts/twitter/bootstrap/collapse.js +108 -96
- data/vendor/assets/javascripts/twitter/bootstrap/dropdown.js +72 -87
- data/vendor/assets/javascripts/twitter/bootstrap/modal.js +149 -155
- data/vendor/assets/javascripts/twitter/bootstrap/popover.js +60 -59
- data/vendor/assets/javascripts/twitter/bootstrap/scrollspy.js +103 -107
- data/vendor/assets/javascripts/twitter/bootstrap/tab.js +73 -82
- data/vendor/assets/javascripts/twitter/bootstrap/tooltip.js +258 -255
- data/vendor/assets/javascripts/twitter/bootstrap/transition.js +34 -38
- data/vendor/frameworks/twitter/bootstrap/accordion.less +9 -12
- data/vendor/frameworks/twitter/bootstrap/alerts.less +43 -53
- data/vendor/frameworks/twitter/bootstrap/bootstrap.less +21 -21
- data/vendor/frameworks/twitter/bootstrap/breadcrumbs.less +7 -8
- data/vendor/frameworks/twitter/bootstrap/button-groups.less +93 -151
- data/vendor/frameworks/twitter/bootstrap/buttons.less +93 -164
- data/vendor/frameworks/twitter/bootstrap/carousel.less +110 -63
- data/vendor/frameworks/twitter/bootstrap/close.less +18 -17
- data/vendor/frameworks/twitter/bootstrap/code.less +14 -20
- data/vendor/frameworks/twitter/bootstrap/component-animations.less +10 -3
- data/vendor/frameworks/twitter/bootstrap/dropdowns.less +66 -143
- data/vendor/frameworks/twitter/bootstrap/forms.less +281 -548
- data/vendor/frameworks/twitter/bootstrap/grid.less +194 -11
- data/vendor/frameworks/twitter/bootstrap/media.less +8 -7
- data/vendor/frameworks/twitter/bootstrap/mixins.less +290 -446
- data/vendor/frameworks/twitter/bootstrap/modals.less +92 -51
- data/vendor/frameworks/twitter/bootstrap/navbar.less +285 -402
- data/vendor/frameworks/twitter/bootstrap/navs.less +176 -348
- data/vendor/frameworks/twitter/bootstrap/pager.less +45 -33
- data/vendor/frameworks/twitter/bootstrap/pagination.less +89 -104
- data/vendor/frameworks/twitter/bootstrap/popovers.less +53 -51
- data/vendor/frameworks/twitter/bootstrap/progress-bars.less +28 -45
- data/vendor/frameworks/twitter/bootstrap/responsive-utilities.less +92 -32
- data/vendor/frameworks/twitter/bootstrap/scaffolding.less +60 -18
- data/vendor/frameworks/twitter/bootstrap/tables.less +131 -164
- data/vendor/frameworks/twitter/bootstrap/thumbnails.less +20 -31
- data/vendor/frameworks/twitter/bootstrap/tooltip.less +45 -20
- data/vendor/frameworks/twitter/bootstrap/type.less +84 -99
- data/vendor/frameworks/twitter/bootstrap/utilities.less +17 -5
- data/vendor/frameworks/twitter/bootstrap/variables.less +446 -179
- data/vendor/frameworks/twitter/bootstrap/wells.less +5 -5
- metadata +41 -44
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/twitter/bootstrap/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/twitter/bootstrap/typeahead.js +0 -335
- data/vendor/assets/stylesheets/twitter/bootstrap-responsive.css.less +0 -1
- data/vendor/assets/stylesheets/twitter/bootstrap.css.less +0 -1
- data/vendor/frameworks/twitter/bootstrap.less +0 -1
- data/vendor/frameworks/twitter/bootstrap/hero-unit.less +0 -25
- data/vendor/frameworks/twitter/bootstrap/labels-badges.less +0 -84
- data/vendor/frameworks/twitter/bootstrap/layouts.less +0 -16
- data/vendor/frameworks/twitter/bootstrap/reset.less +0 -216
- data/vendor/frameworks/twitter/bootstrap/responsive-1200px-min.less +0 -28
- data/vendor/frameworks/twitter/bootstrap/responsive-767px-max.less +0 -193
- data/vendor/frameworks/twitter/bootstrap/responsive-768px-979px.less +0 -19
- data/vendor/frameworks/twitter/bootstrap/responsive-navbar.less +0 -189
- data/vendor/frameworks/twitter/bootstrap/responsive.less +0 -48
- data/vendor/frameworks/twitter/bootstrap/sprites.less +0 -197
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
# Less Rails Bootstrap
|
1
|
+
# Less Rails Bootstrap 3.0.0-rc1 [![Build Status](https://travis-ci.org/metaskills/less-rails-bootstrap.png?branch=3.0.0-rc1)](https://travis-ci.org/metaskills/less-rails-bootstrap)
|
2
2
|
|
3
|
-
|
3
|
+
This fork is using
|
4
|
+
[3.0.0-wip](https://github.com/twbs/bootstrap/tree/3.0.0-wip) [Twitter Bootstrap](https://github.com/twbs/bootstrap) branch. You can read about new bootstrap version [here](https://github.com/twitter/bootstrap/pull/6342).
|
5
|
+
|
6
|
+
Bootstrap is Twitter's toolkit for kickstarting your site or app's CSS. It includes base styles for typography, forms, buttons, tables, grid layout, navigation, alerts, and more. To get started -- check out the [Bootstrap docs](http://getbootstrap.com/).
|
4
7
|
|
5
8
|
The less-rails-bootstrap project hooks into [less-rails](http://github.com/metaskills/less-rails) and [less.rb](http://github.com/cowboyd/less.rb), making Bootstrap's source LESS files, compiled CSS, and JavaScript files available in the Rails 3.1+ asset pipeline.
|
6
9
|
|
@@ -21,7 +24,7 @@ LESS requires a JavaScript runtime to work. Which one you use depends on your Ru
|
|
21
24
|
gem 'therubyracer' # If using Ruby
|
22
25
|
gem 'therubyrhino' # If using JRuby
|
23
26
|
gem 'jquery-rails' # If using Bootstrap's JS plugins.
|
24
|
-
gem 'less-rails-bootstrap'
|
27
|
+
gem 'less-rails-bootstrap', '3.0.0.rc1', github: 'metaskills/less-rails-bootstrap', branch: '3.0.0-rc1'
|
25
28
|
```
|
26
29
|
|
27
30
|
## Basic CSS Use
|
@@ -32,11 +35,6 @@ Get the full Bootstrap stylesheet with a single line in your `application.css`.
|
|
32
35
|
*= require twitter/bootstrap
|
33
36
|
*/
|
34
37
|
|
35
|
-
If you wish to make use of Bootstraps' responsive features, like the collapsing of your navigation bar on window resize, make sure to include bootstrap-responsive as well.
|
36
|
-
|
37
|
-
/*
|
38
|
-
*= require twitter/bootstrap-responsive
|
39
|
-
*/
|
40
38
|
|
41
39
|
Please see the [less-rails-bootstrap-test](http://github.com/metaskills/less-rails-bootstrap-test) repo for examples that customize the CSS output by using LESS. The "CSS Tests Suites" section of the README and code is what you want to focus on. Also, check out the [LESS syntax](http://lesscss.org/).
|
42
40
|
|
@@ -69,8 +67,6 @@ This gem will directly track the semantic versioning of the Twitter Bootstrap pr
|
|
69
67
|
|
70
68
|
Simple! Just clone the repo, then run `bundle install` and `bundle exec rake`. The tests will begin to run. We also use Travis CI to run our tests. The current build status is:
|
71
69
|
|
72
|
-
[![Build Status](https://secure.travis-ci.org/metaskills/less-rails-bootstrap.png)](http://travis-ci.org/metaskills/less-rails-bootstrap)
|
73
|
-
|
74
70
|
We also have a test rails project setup using all the examples documented above. If you make a github issue and complain about something, I will likely forward you to this project.
|
75
71
|
|
76
72
|
[https://github.com/metaskills/less-rails-bootstrap-test](https://github.com/metaskills/less-rails-bootstrap-test)
|
@@ -82,7 +78,7 @@ Here are the steps to update the version of twitter bootstrap used.
|
|
82
78
|
|
83
79
|
* Clone this repository.
|
84
80
|
* Clone the [bootstrap repo](https://github.com/twitter/bootstrap) in a twitter/bootstrap directory next to the clone of less-rails-bootstrap done above.
|
85
|
-
* Change directories into the twitter/bootstrap clone and do a git checkout on the version you are targeting. For example `git checkout
|
81
|
+
* Change directories into the twitter/bootstrap clone and do a git checkout on the version you are targeting. For example `git checkout 3.0.0-wip`. This will setup the proper version to copy over.
|
86
82
|
* Back in the less-rails-bootstrap project. Run the `./scripts/update_bootstrap.sh` script.
|
87
83
|
* RUN THE TESTS!
|
88
84
|
|
data/scripts/update_bootstrap.sh
CHANGED
@@ -1,33 +1,62 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
-
bs_dir='
|
3
|
+
bs_dir='./twitter/bootstrap'
|
4
4
|
lrb_dir='.'
|
5
|
-
|
5
|
+
lrb_font_dir="$lrb_dir/vendor/assets/fonts/twitter/bootstrap"
|
6
6
|
lrb_js_dir="$lrb_dir/vendor/assets/javascripts/twitter/bootstrap"
|
7
7
|
lrb_styles_dir="$lrb_dir/vendor/assets/stylesheets/twitter"
|
8
8
|
lrb_fw_dir="$lrb_dir/vendor/frameworks/twitter/bootstrap"
|
9
9
|
|
10
|
+
error() {
|
11
|
+
echo -e "\e[1;31m"$1"\e[0m"
|
12
|
+
}
|
13
|
+
|
14
|
+
success() {
|
15
|
+
echo -e "\e[1;32m"$1"\e[0m"
|
16
|
+
}
|
17
|
+
|
18
|
+
info() {
|
19
|
+
echo -e "\e[1;34m"$1"\e[0m"
|
20
|
+
}
|
21
|
+
|
22
|
+
if [ $# -ne 1 ]
|
23
|
+
then
|
24
|
+
error "USAGE: $0 <bootstrap version>"
|
25
|
+
exit 1
|
26
|
+
fi
|
27
|
+
|
10
28
|
if [ ! -d $bs_dir ]; then
|
11
|
-
|
12
|
-
|
29
|
+
info "Bootstrap not found. Cloning to twitter/bootstrap..."
|
30
|
+
git clone --quiet git://github.com/twbs/bootstrap.git twitter/bootstrap
|
13
31
|
fi
|
14
32
|
|
15
|
-
|
16
|
-
|
33
|
+
cd twitter/bootstrap
|
34
|
+
info "Using $1..."
|
35
|
+
git checkout --quiet $1
|
36
|
+
cd ../../
|
37
|
+
|
38
|
+
info "Copying fonts..."
|
39
|
+
# fonts
|
40
|
+
mkdir -p $lrb_font_dir/
|
41
|
+
for f in $bs_dir/fonts/*; do
|
17
42
|
bn=$(basename $f)
|
18
|
-
cp $f $
|
43
|
+
cp $f $lrb_font_dir/$bn
|
19
44
|
done
|
20
45
|
|
46
|
+
info "Copying scripts..."
|
21
47
|
# scripts
|
22
48
|
for f in $bs_dir/js/*.js; do
|
23
49
|
bn=$(basename $f)
|
24
50
|
cp $f $lrb_js_dir/${bn/bootstrap-/}
|
25
51
|
done
|
26
52
|
|
53
|
+
info "Copying styles..."
|
27
54
|
# styles
|
28
55
|
for f in $bs_dir/less/*.less; do
|
29
56
|
bn=$(basename $f)
|
30
|
-
sed -e
|
57
|
+
sed -e "s/url('@{glyphicons-font-path}/asset-url('twitter\/bootstrap/g" \
|
31
58
|
-e 's#background-image: url(#background-image: asset-url(#g' \
|
32
59
|
$f > $lrb_fw_dir/$bn
|
33
60
|
done
|
61
|
+
|
62
|
+
success "Done"
|
@@ -7,16 +7,21 @@ class UsageCssSpec < Less::Rails::Bootstrap::Spec
|
|
7
7
|
let(:app_css) { dummy_asset('application.css') }
|
8
8
|
|
9
9
|
it 'will render main bootstrap.less file and all included modules' do
|
10
|
-
app_css.must_include 'Bootstrap
|
10
|
+
app_css.must_include 'Bootstrap v3'
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'must include basic css afterward' do
|
14
14
|
app_css.must_include '#other-css { color: red; }', 'From our code afterward.'
|
15
15
|
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
end
|
18
|
+
|
19
|
+
describe 'fonts.css.less' do
|
20
|
+
|
21
|
+
let(:app_css) { dummy_asset('fonts.css.less') }
|
22
|
+
|
23
|
+
it 'uses less-rails asset-url helper for fonts' do
|
24
|
+
app_css.must_include 'url(/assets/twitter/bootstrap/glyphiconshalflings-regular.eot)'
|
20
25
|
end
|
21
26
|
|
22
27
|
end
|
@@ -28,15 +33,14 @@ class UsageCssSpec < Less::Rails::Bootstrap::Spec
|
|
28
33
|
let(:framework_css) { dummy_asset('framework.css') }
|
29
34
|
|
30
35
|
it 'will render bootstrap functions' do
|
31
|
-
border_radius_line = line_for_framework_css('framework-
|
32
|
-
border_radius_line.must_include '-webkit-
|
33
|
-
border_radius_line.must_include '-
|
34
|
-
border_radius_line.must_include 'border-radius:4px'
|
36
|
+
border_radius_line = line_for_framework_css('framework-box-shadow')
|
37
|
+
border_radius_line.must_include '-webkit-box-shadow:4px'
|
38
|
+
border_radius_line.must_include 'box-shadow:4px'
|
35
39
|
end
|
36
40
|
|
37
41
|
it 'will render bootstrap variables' do
|
38
42
|
link_color_line = line_for_framework_css('framework-linkColor')
|
39
|
-
link_color_line.must_include 'color:#
|
43
|
+
link_color_line.must_include 'color:#428bca;'
|
40
44
|
end
|
41
45
|
|
42
46
|
end
|
@@ -49,9 +53,8 @@ class UsageCssSpec < Less::Rails::Bootstrap::Spec
|
|
49
53
|
|
50
54
|
it 'will render bootstrap variables and mixins' do
|
51
55
|
my_button_line = line_for_individual_css('individual-my-button')
|
52
|
-
my_button_line.must_include '-webkit-
|
53
|
-
my_button_line.must_include '-
|
54
|
-
my_button_line.must_include 'border-radius:10px'
|
56
|
+
my_button_line.must_include '-webkit-box-shadow:10px'
|
57
|
+
my_button_line.must_include 'box-shadow:10px'
|
55
58
|
end
|
56
59
|
|
57
60
|
end
|
data/test/cases/usage_js_spec.rb
CHANGED
@@ -7,10 +7,10 @@ class UsageJsSpec < Less::Rails::Bootstrap::Spec
|
|
7
7
|
let(:app_js) { dummy_asset('application.js') }
|
8
8
|
|
9
9
|
it 'will render main bootstrap.js file and all included modules' do
|
10
|
-
files = ['alert', 'button', 'carousel', 'collapse', 'dropdown', 'modal',
|
11
|
-
'popover', 'scrollspy', 'tab', 'tooltip', 'transition'
|
10
|
+
files = ['affix', 'alert', 'button', 'carousel', 'collapse', 'dropdown', 'modal',
|
11
|
+
'popover', 'scrollspy', 'tab', 'tooltip', 'transition']
|
12
12
|
files.each do |file|
|
13
|
-
app_js.must_include "
|
13
|
+
app_js.must_include "#{file}.js"
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -25,7 +25,7 @@ class UsageJsSpec < Less::Rails::Bootstrap::Spec
|
|
25
25
|
let(:individual_js) { dummy_asset('individual.js') }
|
26
26
|
|
27
27
|
it 'will render bootstrap variables and mixins' do
|
28
|
-
individual_js.must_include '
|
28
|
+
individual_js.must_include 'modal.js'
|
29
29
|
end
|
30
30
|
|
31
31
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
@import "twitter/bootstrap";
|
2
|
+
@import "twitter/bootstrap/mixins";
|
3
|
+
@import "twitter/bootstrap/variables";
|
2
4
|
|
3
5
|
#framework-start{color:red;}
|
4
6
|
|
5
|
-
#framework-
|
6
|
-
#framework-linkColor { color: @
|
7
|
+
#framework-box-shadow { .box-shadow(4px); }
|
8
|
+
#framework-linkColor { color: @link-color; }
|
data/test/spec_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
/*
|
2
|
-
*
|
3
|
-
* http://
|
4
|
-
*
|
1
|
+
/* ========================================================================
|
2
|
+
* Bootstrap: affix.js v3.0.0
|
3
|
+
* http://twbs.github.com/bootstrap/javascript.html#affix
|
4
|
+
* ========================================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -15,80 +15,90 @@
|
|
15
15
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
16
|
* See the License for the specific language governing permissions and
|
17
17
|
* limitations under the License.
|
18
|
-
*
|
18
|
+
* ======================================================================== */
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
+function ($) { "use strict";
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
/* AFFIX CLASS DEFINITION
|
27
|
-
* ====================== */
|
23
|
+
// AFFIX CLASS DEFINITION
|
24
|
+
// ======================
|
28
25
|
|
29
26
|
var Affix = function (element, options) {
|
30
|
-
this.options = $.extend({},
|
27
|
+
this.options = $.extend({}, Affix.DEFAULTS, options)
|
31
28
|
this.$window = $(window)
|
32
|
-
.on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
|
33
|
-
.on('click.affix.data-api', $.proxy(
|
29
|
+
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
30
|
+
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
31
|
+
|
34
32
|
this.$element = $(element)
|
33
|
+
this.affixed =
|
34
|
+
this.unpin = null
|
35
|
+
|
35
36
|
this.checkPosition()
|
36
37
|
}
|
37
38
|
|
39
|
+
Affix.RESET = 'affix affix-top affix-bottom'
|
40
|
+
|
41
|
+
Affix.DEFAULTS = {
|
42
|
+
offset: 0
|
43
|
+
}
|
44
|
+
|
45
|
+
Affix.prototype.checkPositionWithEventLoop = function () {
|
46
|
+
setTimeout($.proxy(this.checkPosition, this), 1)
|
47
|
+
}
|
48
|
+
|
38
49
|
Affix.prototype.checkPosition = function () {
|
39
50
|
if (!this.$element.is(':visible')) return
|
40
51
|
|
41
52
|
var scrollHeight = $(document).height()
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
51
|
-
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
53
|
+
var scrollTop = this.$window.scrollTop()
|
54
|
+
var position = this.$element.offset()
|
55
|
+
var offset = this.options.offset
|
56
|
+
var offsetTop = offset.top
|
57
|
+
var offsetBottom = offset.bottom
|
58
|
+
|
59
|
+
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
60
|
+
if (typeof offsetTop == 'function') offsetTop = offset.top()
|
52
61
|
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
|
53
62
|
|
54
|
-
affix = this.unpin
|
55
|
-
|
56
|
-
|
57
|
-
'top' : false
|
63
|
+
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
64
|
+
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
65
|
+
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
58
66
|
|
59
67
|
if (this.affixed === affix) return
|
68
|
+
if (this.unpin) this.$element.css('top', '')
|
60
69
|
|
61
70
|
this.affixed = affix
|
62
|
-
this.unpin
|
71
|
+
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
|
63
72
|
|
64
|
-
this.$element.removeClass(
|
73
|
+
this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : ''))
|
74
|
+
|
75
|
+
if (affix == 'bottom') {
|
76
|
+
this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
|
77
|
+
}
|
65
78
|
}
|
66
79
|
|
67
80
|
|
68
|
-
|
69
|
-
|
81
|
+
// AFFIX PLUGIN DEFINITION
|
82
|
+
// =======================
|
70
83
|
|
71
84
|
var old = $.fn.affix
|
72
85
|
|
73
86
|
$.fn.affix = function (option) {
|
74
87
|
return this.each(function () {
|
75
|
-
var $this
|
76
|
-
|
77
|
-
|
78
|
-
|
88
|
+
var $this = $(this)
|
89
|
+
var data = $this.data('bs.affix')
|
90
|
+
var options = typeof option == 'object' && option
|
91
|
+
|
92
|
+
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
79
93
|
if (typeof option == 'string') data[option]()
|
80
94
|
})
|
81
95
|
}
|
82
96
|
|
83
97
|
$.fn.affix.Constructor = Affix
|
84
98
|
|
85
|
-
$.fn.affix.defaults = {
|
86
|
-
offset: 0
|
87
|
-
}
|
88
99
|
|
89
|
-
|
90
|
-
|
91
|
-
* ================= */
|
100
|
+
// AFFIX NO CONFLICT
|
101
|
+
// =================
|
92
102
|
|
93
103
|
$.fn.affix.noConflict = function () {
|
94
104
|
$.fn.affix = old
|
@@ -96,22 +106,21 @@
|
|
96
106
|
}
|
97
107
|
|
98
108
|
|
99
|
-
|
100
|
-
|
109
|
+
// AFFIX DATA-API
|
110
|
+
// ==============
|
101
111
|
|
102
112
|
$(window).on('load', function () {
|
103
113
|
$('[data-spy="affix"]').each(function () {
|
104
114
|
var $spy = $(this)
|
105
|
-
|
115
|
+
var data = $spy.data()
|
106
116
|
|
107
117
|
data.offset = data.offset || {}
|
108
118
|
|
109
|
-
data.offsetBottom
|
110
|
-
data.offsetTop
|
119
|
+
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
|
120
|
+
if (data.offsetTop) data.offset.top = data.offsetTop
|
111
121
|
|
112
122
|
$spy.affix(data)
|
113
123
|
})
|
114
124
|
})
|
115
125
|
|
116
|
-
|
117
|
-
}(window.jQuery);
|
126
|
+
}(window.jQuery);
|