jquery-slimscroll-rails 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/jquery-slimscroll-rails.gemspec +19 -0
- data/lib/jquery-slimscroll-rails.rb +9 -0
- data/lib/jquery-slimscroll-rails/engine.rb +6 -0
- data/lib/jquery-slimscroll-rails/version.rb +7 -0
- data/vendor/.DS_Store +0 -0
- data/vendor/assets/.DS_Store +0 -0
- data/vendor/assets/javascripts/jquery.slimscroll.js +378 -0
- data/vendor/assets/javascripts/jquery.slimscroll.min.js +15 -0
- metadata +63 -0
data/.DS_Store
ADDED
Binary file
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Marcos Nogueira
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Jquery::Slimscroll::Rails
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'jquery-slimscroll-rails'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install jquery-slimscroll-rails
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jquery-slimscroll-rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "jquery-slimscroll-rails"
|
8
|
+
gem.version = Jquery::Slimscroll::Rails::VERSION
|
9
|
+
gem.authors = ["Marcos Nogueira"]
|
10
|
+
gem.email = ["marcosnogueiraalves@gmail.com"]
|
11
|
+
gem.description = %q{slimScroll is a small (3.7KB) jQuery plugin that transforms any div into a scrollable area with a nice scrollbar - similar to the one Facebook and Google started using in their products recently. slimScroll doesn't occupy any visual space as it only appears on a user initiated mouse-over. User can drag the scrollbar or use mouse-wheel to change the scroll value.}
|
12
|
+
gem.summary = %q{Integrate the jQuery SlimScroll plugin into the Rails asset pipeline}
|
13
|
+
gem.homepage = "http://github.com/marcosnogueira/jquery-slimscroll-rails"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
data/vendor/.DS_Store
ADDED
Binary file
|
Binary file
|
@@ -0,0 +1,378 @@
|
|
1
|
+
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
|
2
|
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
3
|
+
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
4
|
+
*
|
5
|
+
* Version: 1.0.9
|
6
|
+
*
|
7
|
+
*/
|
8
|
+
(function($) {
|
9
|
+
|
10
|
+
jQuery.fn.extend({
|
11
|
+
slimScroll: function(options) {
|
12
|
+
|
13
|
+
var defaults = {
|
14
|
+
wheelStep : 20,
|
15
|
+
width : 'auto',
|
16
|
+
height : '250px',
|
17
|
+
size : '7px',
|
18
|
+
color: '#000',
|
19
|
+
position : 'right',
|
20
|
+
distance : '1px',
|
21
|
+
start : 'top',
|
22
|
+
opacity : .4,
|
23
|
+
alwaysVisible : false,
|
24
|
+
disableFadeOut: false,
|
25
|
+
railVisible : false,
|
26
|
+
railColor : '#333',
|
27
|
+
railOpacity : '0.2',
|
28
|
+
railClass : 'slimScrollRail',
|
29
|
+
barClass : 'slimScrollBar',
|
30
|
+
wrapperClass : 'slimScrollDiv',
|
31
|
+
allowPageScroll : false,
|
32
|
+
scroll : 0,
|
33
|
+
touchScrollStep : 200
|
34
|
+
};
|
35
|
+
|
36
|
+
var o = $.extend(defaults, options);
|
37
|
+
|
38
|
+
// do it for every element that matches selector
|
39
|
+
this.each(function(){
|
40
|
+
|
41
|
+
var isOverPanel, isOverBar, isDragg, queueHide, touchDif,
|
42
|
+
barHeight, percentScroll, lastScroll,
|
43
|
+
divS = '<div></div>',
|
44
|
+
minBarHeight = 30,
|
45
|
+
releaseScroll = false;
|
46
|
+
|
47
|
+
// used in event handlers and for better minification
|
48
|
+
var me = $(this);
|
49
|
+
|
50
|
+
// ensure we are not binding it again
|
51
|
+
if (me.parent().hasClass('slimScrollDiv'))
|
52
|
+
{
|
53
|
+
// start from last bar position
|
54
|
+
var offset = me.scrollTop();
|
55
|
+
|
56
|
+
// find bar and rail
|
57
|
+
bar = me.parent().find('.slimScrollBar');
|
58
|
+
rail = me.parent().find('.slimScrollRail');
|
59
|
+
|
60
|
+
getBarHeight();
|
61
|
+
|
62
|
+
// check if we should scroll existing instance
|
63
|
+
if (options)
|
64
|
+
{
|
65
|
+
if ('scrollTo' in options)
|
66
|
+
{
|
67
|
+
// jump to a static point
|
68
|
+
offset = parseInt(o.scrollTo);
|
69
|
+
}
|
70
|
+
else if ('scrollBy' in options)
|
71
|
+
{
|
72
|
+
// jump by value pixels
|
73
|
+
offset += parseInt(o.scrollBy);
|
74
|
+
}
|
75
|
+
else if ('destroy' in options)
|
76
|
+
{
|
77
|
+
// remove slimscroll elements
|
78
|
+
bar.remove();
|
79
|
+
rail.remove();
|
80
|
+
me.unwrap();
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
|
84
|
+
// scroll content by the given offset
|
85
|
+
scrollContent(offset, false, true);
|
86
|
+
}
|
87
|
+
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
|
91
|
+
// optionally set height to the parent's height
|
92
|
+
o.height = (o.height == 'auto') ? me.parent().innerHeight() : o.height;
|
93
|
+
|
94
|
+
// wrap content
|
95
|
+
var wrapper = $(divS)
|
96
|
+
.addClass(o.wrapperClass)
|
97
|
+
.css({
|
98
|
+
position: 'relative',
|
99
|
+
overflow: 'hidden',
|
100
|
+
width: o.width,
|
101
|
+
height: o.height
|
102
|
+
});
|
103
|
+
|
104
|
+
// update style for the div
|
105
|
+
me.css({
|
106
|
+
overflow: 'hidden',
|
107
|
+
width: o.width,
|
108
|
+
height: o.height
|
109
|
+
});
|
110
|
+
|
111
|
+
// create scrollbar rail
|
112
|
+
var rail = $(divS)
|
113
|
+
.addClass(o.railClass)
|
114
|
+
.css({
|
115
|
+
width: o.size,
|
116
|
+
height: '100%',
|
117
|
+
position: 'absolute',
|
118
|
+
top: 0,
|
119
|
+
display: (o.alwaysVisible && o.railVisible) ? 'block' : 'none',
|
120
|
+
'border-radius': o.size,
|
121
|
+
background: o.railColor,
|
122
|
+
opacity: o.railOpacity,
|
123
|
+
zIndex: 90
|
124
|
+
});
|
125
|
+
|
126
|
+
// create scrollbar
|
127
|
+
var bar = $(divS)
|
128
|
+
.addClass(o.barClass)
|
129
|
+
.css({
|
130
|
+
background: o.color,
|
131
|
+
width: o.size,
|
132
|
+
position: 'absolute',
|
133
|
+
top: 0,
|
134
|
+
opacity: o.opacity,
|
135
|
+
display: o.alwaysVisible ? 'block' : 'none',
|
136
|
+
'border-radius' : o.size,
|
137
|
+
BorderRadius: o.size,
|
138
|
+
MozBorderRadius: o.size,
|
139
|
+
WebkitBorderRadius: o.size,
|
140
|
+
zIndex: 99
|
141
|
+
});
|
142
|
+
|
143
|
+
// set position
|
144
|
+
var posCss = (o.position == 'right') ? { right: o.distance } : { left: o.distance };
|
145
|
+
rail.css(posCss);
|
146
|
+
bar.css(posCss);
|
147
|
+
|
148
|
+
// wrap it
|
149
|
+
me.wrap(wrapper);
|
150
|
+
|
151
|
+
// append to parent div
|
152
|
+
me.parent().append(bar);
|
153
|
+
me.parent().append(rail);
|
154
|
+
|
155
|
+
// make it draggable
|
156
|
+
bar.draggable({
|
157
|
+
axis: 'y',
|
158
|
+
containment: 'parent',
|
159
|
+
start: function() { isDragg = true; },
|
160
|
+
stop: function() { isDragg = false; hideBar(); },
|
161
|
+
drag: function(e)
|
162
|
+
{
|
163
|
+
// scroll content
|
164
|
+
scrollContent(0, $(this).position().top, false);
|
165
|
+
}
|
166
|
+
});
|
167
|
+
|
168
|
+
// on rail over
|
169
|
+
rail.hover(function(){
|
170
|
+
showBar();
|
171
|
+
}, function(){
|
172
|
+
hideBar();
|
173
|
+
});
|
174
|
+
|
175
|
+
// on bar over
|
176
|
+
bar.hover(function(){
|
177
|
+
isOverBar = true;
|
178
|
+
}, function(){
|
179
|
+
isOverBar = false;
|
180
|
+
});
|
181
|
+
|
182
|
+
// show on parent mouseover
|
183
|
+
me.hover(function(){
|
184
|
+
isOverPanel = true;
|
185
|
+
showBar();
|
186
|
+
hideBar();
|
187
|
+
}, function(){
|
188
|
+
isOverPanel = false;
|
189
|
+
hideBar();
|
190
|
+
});
|
191
|
+
|
192
|
+
// support for mobile
|
193
|
+
me.bind('touchstart', function(e,b){
|
194
|
+
if (e.originalEvent.touches.length)
|
195
|
+
{
|
196
|
+
// record where touch started
|
197
|
+
touchDif = e.originalEvent.touches[0].pageY;
|
198
|
+
}
|
199
|
+
});
|
200
|
+
|
201
|
+
me.bind('touchmove', function(e){
|
202
|
+
// prevent scrolling the page
|
203
|
+
e.originalEvent.preventDefault();
|
204
|
+
if (e.originalEvent.touches.length)
|
205
|
+
{
|
206
|
+
// see how far user swiped
|
207
|
+
var diff = (touchDif - e.originalEvent.touches[0].pageY) / o.touchScrollStep;
|
208
|
+
// scroll content
|
209
|
+
scrollContent(diff, true);
|
210
|
+
}
|
211
|
+
});
|
212
|
+
|
213
|
+
var _onWheel = function(e)
|
214
|
+
{
|
215
|
+
// use mouse wheel only when mouse is over
|
216
|
+
if (!isOverPanel) { return; }
|
217
|
+
|
218
|
+
var e = e || window.event;
|
219
|
+
|
220
|
+
var delta = 0;
|
221
|
+
if (e.wheelDelta) { delta = -e.wheelDelta/120; }
|
222
|
+
if (e.detail) { delta = e.detail / 3; }
|
223
|
+
|
224
|
+
var target = e.target || e.srcTarget;
|
225
|
+
if ($(target).closest('.' + o.wrapperClass).is(me.parent())) {
|
226
|
+
// scroll content
|
227
|
+
scrollContent(delta, true);
|
228
|
+
}
|
229
|
+
|
230
|
+
// stop window scroll
|
231
|
+
if (e.preventDefault && !releaseScroll) { e.preventDefault(); }
|
232
|
+
if (!releaseScroll) { e.returnValue = false; }
|
233
|
+
}
|
234
|
+
|
235
|
+
function scrollContent(y, isWheel, isJump)
|
236
|
+
{
|
237
|
+
var delta = y;
|
238
|
+
var maxTop = me.outerHeight() - bar.outerHeight();
|
239
|
+
|
240
|
+
if (isWheel)
|
241
|
+
{
|
242
|
+
// move bar with mouse wheel
|
243
|
+
delta = parseInt(bar.css('top')) + y * parseInt(o.wheelStep) / 100 * bar.outerHeight();
|
244
|
+
|
245
|
+
// move bar, make sure it doesn't go out
|
246
|
+
delta = Math.min(Math.max(delta, 0), maxTop);
|
247
|
+
|
248
|
+
// if scrolling down, make sure a fractional change to the
|
249
|
+
// scroll position isn't rounded away when the scrollbar's CSS is set
|
250
|
+
// this flooring of delta would happened automatically when
|
251
|
+
// bar.css is set below, but we floor here for clarity
|
252
|
+
delta = (y > 0) ? Math.ceil(delta) : Math.floor(delta);
|
253
|
+
|
254
|
+
// scroll the scrollbar
|
255
|
+
bar.css({ top: delta + 'px' });
|
256
|
+
}
|
257
|
+
|
258
|
+
// calculate actual scroll amount
|
259
|
+
percentScroll = parseInt(bar.css('top')) / (me.outerHeight() - bar.outerHeight());
|
260
|
+
delta = percentScroll * (me[0].scrollHeight - me.outerHeight());
|
261
|
+
|
262
|
+
if (isJump)
|
263
|
+
{
|
264
|
+
delta = y;
|
265
|
+
var offsetTop = delta / me[0].scrollHeight * me.outerHeight();
|
266
|
+
offsetTop = Math.min(Math.max(offsetTop, 0), maxTop);
|
267
|
+
bar.css({ top: offsetTop + 'px' });
|
268
|
+
}
|
269
|
+
|
270
|
+
// scroll content
|
271
|
+
me.scrollTop(delta);
|
272
|
+
|
273
|
+
// ensure bar is visible
|
274
|
+
showBar();
|
275
|
+
|
276
|
+
// trigger hide when scroll is stopped
|
277
|
+
hideBar();
|
278
|
+
}
|
279
|
+
|
280
|
+
var attachWheel = function()
|
281
|
+
{
|
282
|
+
if (window.addEventListener)
|
283
|
+
{
|
284
|
+
this.addEventListener('DOMMouseScroll', _onWheel, false );
|
285
|
+
this.addEventListener('mousewheel', _onWheel, false );
|
286
|
+
}
|
287
|
+
else
|
288
|
+
{
|
289
|
+
document.attachEvent("onmousewheel", _onWheel)
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
// attach scroll events
|
294
|
+
attachWheel();
|
295
|
+
|
296
|
+
function getBarHeight()
|
297
|
+
{
|
298
|
+
// calculate scrollbar height and make sure it is not too small
|
299
|
+
barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight);
|
300
|
+
bar.css({ height: barHeight + 'px' });
|
301
|
+
}
|
302
|
+
|
303
|
+
// set up initial height
|
304
|
+
getBarHeight();
|
305
|
+
|
306
|
+
function showBar()
|
307
|
+
{
|
308
|
+
// recalculate bar height
|
309
|
+
getBarHeight();
|
310
|
+
clearTimeout(queueHide);
|
311
|
+
|
312
|
+
// when bar reached top or bottom
|
313
|
+
if (percentScroll == ~~ percentScroll)
|
314
|
+
{
|
315
|
+
//release wheel
|
316
|
+
releaseScroll = o.allowPageScroll;
|
317
|
+
|
318
|
+
// publish approporiate event
|
319
|
+
if (lastScroll != percentScroll)
|
320
|
+
{
|
321
|
+
var msg = (~~percentScroll == 0) ? 'top' : 'bottom';
|
322
|
+
me.trigger('slimscroll', msg);
|
323
|
+
}
|
324
|
+
}
|
325
|
+
lastScroll = percentScroll;
|
326
|
+
|
327
|
+
// show only when required
|
328
|
+
if(barHeight >= me.outerHeight()) {
|
329
|
+
//allow window scroll
|
330
|
+
releaseScroll = true;
|
331
|
+
return;
|
332
|
+
}
|
333
|
+
bar.stop(true,true).fadeIn('fast');
|
334
|
+
if (o.railVisible) { rail.stop(true,true).fadeIn('fast'); }
|
335
|
+
}
|
336
|
+
|
337
|
+
function hideBar()
|
338
|
+
{
|
339
|
+
// only hide when options allow it
|
340
|
+
if (!o.alwaysVisible)
|
341
|
+
{
|
342
|
+
queueHide = setTimeout(function(){
|
343
|
+
if (!(o.disableFadeOut && isOverPanel) && !isOverBar && !isDragg)
|
344
|
+
{
|
345
|
+
bar.fadeOut('slow');
|
346
|
+
rail.fadeOut('slow');
|
347
|
+
}
|
348
|
+
}, 1000);
|
349
|
+
}
|
350
|
+
}
|
351
|
+
|
352
|
+
// check start position
|
353
|
+
if (o.start == 'bottom')
|
354
|
+
{
|
355
|
+
// scroll content to bottom
|
356
|
+
bar.css({ top: me.outerHeight() - bar.outerHeight() });
|
357
|
+
scrollContent(0, true);
|
358
|
+
}
|
359
|
+
else if (typeof o.start == 'object')
|
360
|
+
{
|
361
|
+
// scroll content
|
362
|
+
scrollContent($(o.start).position().top, null, true);
|
363
|
+
|
364
|
+
// make sure bar stays hidden
|
365
|
+
if (!o.alwaysVisible) { bar.hide(); }
|
366
|
+
}
|
367
|
+
});
|
368
|
+
|
369
|
+
// maintain chainability
|
370
|
+
return this;
|
371
|
+
}
|
372
|
+
});
|
373
|
+
|
374
|
+
jQuery.fn.extend({
|
375
|
+
slimscroll: jQuery.fn.slimScroll
|
376
|
+
});
|
377
|
+
|
378
|
+
})(jQuery);
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
|
2
|
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
3
|
+
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
4
|
+
*
|
5
|
+
* Version: 1.0.9
|
6
|
+
*
|
7
|
+
*/
|
8
|
+
(function(f){jQuery.fn.extend({slimScroll:function(l){var a=f.extend({wheelStep:20,width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:"0.2",railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,scroll:0,touchScrollStep:200},l);this.each(function(){function g(d,f,h){var e=d,g=b.outerHeight()-c.outerHeight();f&&(e=parseInt(c.css("top"))+
|
9
|
+
d*parseInt(a.wheelStep)/100*c.outerHeight(),e=Math.min(Math.max(e,0),g),e=0<d?Math.ceil(e):Math.floor(e),c.css({top:e+"px"}));j=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());e=j*(b[0].scrollHeight-b.outerHeight());h&&(e=d,d=e/b[0].scrollHeight*b.outerHeight(),d=Math.min(Math.max(d,0),g),c.css({top:d+"px"}));b.scrollTop(e);q();m()}function r(){s=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),A);c.css({height:s+"px"})}function q(){r();clearTimeout(w);j==~~j&&(n=a.allowPageScroll,
|
10
|
+
x!=j&&b.trigger("slimscroll",0==~~j?"top":"bottom"));x=j;s>=b.outerHeight()?n=!0:(c.stop(!0,!0).fadeIn("fast"),a.railVisible&&h.stop(!0,!0).fadeIn("fast"))}function m(){a.alwaysVisible||(w=setTimeout(function(){if((!a.disableFadeOut||!p)&&!t&&!u)c.fadeOut("slow"),h.fadeOut("slow")},1E3))}var p,t,u,w,y,s,j,x,A=30,n=!1,b=f(this);if(b.parent().hasClass("slimScrollDiv")){var k=b.scrollTop(),c=b.parent().find(".slimScrollBar"),h=b.parent().find(".slimScrollRail");r();if(l){if("scrollTo"in l)k=parseInt(a.scrollTo);
|
11
|
+
else if("scrollBy"in l)k+=parseInt(a.scrollBy);else if("destroy"in l){c.remove();h.remove();b.unwrap();return}g(k,!1,!0)}}else{a.height="auto"==a.height?b.parent().innerHeight():a.height;k=f("<div></div>").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var h=f("<div></div>").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?
|
12
|
+
"block":"none","border-radius":a.size,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=f("<div></div>").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?"block":"none","border-radius":a.size,BorderRadius:a.size,MozBorderRadius:a.size,WebkitBorderRadius:a.size,zIndex:99}),z="right"==a.position?{right:a.distance}:{left:a.distance};h.css(z);c.css(z);b.wrap(k);b.parent().append(c);b.parent().append(h);c.draggable({axis:"y",
|
13
|
+
containment:"parent",start:function(){u=!0},stop:function(){u=!1;m()},drag:function(){g(0,f(this).position().top,!1)}});h.hover(function(){q()},function(){m()});c.hover(function(){t=!0},function(){t=!1});b.hover(function(){p=!0;q();m()},function(){p=!1;m()});b.bind("touchstart",function(a){a.originalEvent.touches.length&&(y=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){b.originalEvent.preventDefault();b.originalEvent.touches.length&&g((y-b.originalEvent.touches[0].pageY)/a.touchScrollStep,
|
14
|
+
!0)});var v=function(d){if(p){d=d||window.event;var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);f(d.target||d.srcTarget).closest("."+a.wrapperClass).is(b.parent())&&g(c,!0);d.preventDefault&&!n&&d.preventDefault();n||(d.returnValue=!1)}};(function(){window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)})();r();"bottom"==a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),g(0,!0)):
|
15
|
+
"object"==typeof a.start&&(g(f(a.start).position().top,null,!0),a.alwaysVisible||c.hide())}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jquery-slimscroll-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.9
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Marcos Nogueira
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-07 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: slimScroll is a small (3.7KB) jQuery plugin that transforms any div into
|
15
|
+
a scrollable area with a nice scrollbar - similar to the one Facebook and Google
|
16
|
+
started using in their products recently. slimScroll doesn't occupy any visual space
|
17
|
+
as it only appears on a user initiated mouse-over. User can drag the scrollbar or
|
18
|
+
use mouse-wheel to change the scroll value.
|
19
|
+
email:
|
20
|
+
- marcosnogueiraalves@gmail.com
|
21
|
+
executables: []
|
22
|
+
extensions: []
|
23
|
+
extra_rdoc_files: []
|
24
|
+
files:
|
25
|
+
- .DS_Store
|
26
|
+
- .gitignore
|
27
|
+
- Gemfile
|
28
|
+
- LICENSE.txt
|
29
|
+
- README.md
|
30
|
+
- Rakefile
|
31
|
+
- jquery-slimscroll-rails.gemspec
|
32
|
+
- lib/jquery-slimscroll-rails.rb
|
33
|
+
- lib/jquery-slimscroll-rails/engine.rb
|
34
|
+
- lib/jquery-slimscroll-rails/version.rb
|
35
|
+
- vendor/.DS_Store
|
36
|
+
- vendor/assets/.DS_Store
|
37
|
+
- vendor/assets/javascripts/jquery.slimscroll.js
|
38
|
+
- vendor/assets/javascripts/jquery.slimscroll.min.js
|
39
|
+
homepage: http://github.com/marcosnogueira/jquery-slimscroll-rails
|
40
|
+
licenses: []
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - ! '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ! '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
requirements: []
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 1.8.24
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: Integrate the jQuery SlimScroll plugin into the Rails asset pipeline
|
63
|
+
test_files: []
|