Skip to content

Commit fa68775

Browse files
author
Robin Komiwes
committed
Added spaces after each inline comment start.
1 parent 5d33775 commit fa68775

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

slimScroll.js

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
slimScroll: function(o) {
1212

1313
var ops = o;
14-
//do it for every element that matches selector
14+
// do it for every element that matches selector
1515
this.each(function(){
1616

1717
var isOverPanel, isOverBar, isDragg, queueHide, barHeight,
@@ -33,25 +33,25 @@
3333
railColor = o.railColor || '#333',
3434
railOpacity = o.railOpacity || 0.2;
3535

36-
//used in event handlers and for better minification
36+
// used in event handlers and for better minification
3737
var me = $(this);
3838

39-
//wrap content
39+
// wrap content
4040
var wrapper = $(divS).css({
4141
position: 'relative',
4242
overflow: 'hidden',
4343
width: cwidth,
4444
height: cheight
4545
}).attr({ 'class': 'slimScrollDiv' });
4646

47-
//update style for the div
47+
// update style for the div
4848
me.css({
4949
overflow: 'hidden',
5050
width: cwidth,
5151
height: cheight
5252
});
5353

54-
//create scrollbar rail
54+
// create scrollbar rail
5555
var rail = $(divS).css({
5656
width: size,
5757
height: '100%',
@@ -64,7 +64,7 @@
6464
zIndex: 90
6565
});
6666

67-
//create scrollbar
67+
// create scrollbar
6868
var bar = $(divS).attr({
6969
'class': 'slimScrollBar ',
7070
style: 'border-radius: ' + size
@@ -81,46 +81,46 @@
8181
zIndex: 99
8282
});
8383

84-
//set position
84+
// set position
8585
var posCss = (position == 'right') ? { right: distance } : { left: distance };
8686
rail.css(posCss);
8787
bar.css(posCss);
8888

89-
//wrap it
89+
// wrap it
9090
me.wrap(wrapper);
9191

92-
//append to parent div
92+
// append to parent div
9393
me.parent().append(bar);
9494
me.parent().append(rail);
9595

96-
//make it draggable
96+
// make it draggable
9797
bar.draggable({
9898
axis: 'y',
9999
containment: 'parent',
100100
start: function() { isDragg = true; },
101101
stop: function() { isDragg = false; hideBar(); },
102102
drag: function(e)
103103
{
104-
//scroll content
104+
// scroll content
105105
scrollContent(0, $(this).position().top, false);
106106
}
107107
});
108108

109-
//on rail over
109+
// on rail over
110110
rail.hover(function(){
111111
showBar();
112112
}, function(){
113113
hideBar();
114114
});
115115

116-
//on bar over
116+
// on bar over
117117
bar.hover(function(){
118118
isOverBar = true;
119119
}, function(){
120120
isOverBar = false;
121121
});
122122

123-
//show on parent mouseover
123+
// show on parent mouseover
124124
me.hover(function(){
125125
isOverPanel = true;
126126
showBar();
@@ -132,7 +132,7 @@
132132

133133
var _onWheel = function(e)
134134
{
135-
//use mouse wheel only when mouse is over
135+
// use mouse wheel only when mouse is over
136136
if (!isOverPanel) { return; }
137137

138138
var e = e || window.event;
@@ -141,10 +141,10 @@
141141
if (e.wheelDelta) { delta = -e.wheelDelta/120; }
142142
if (e.detail) { delta = e.detail / 3; }
143143

144-
//scroll content
144+
// scroll content
145145
scrollContent(delta, true);
146146

147-
//stop window scroll
147+
// stop window scroll
148148
if (e.preventDefault && !releaseScroll) { e.preventDefault(); }
149149
if (!releaseScroll) { e.returnValue = false; }
150150
}
@@ -155,19 +155,19 @@
155155

156156
if (isWheel)
157157
{
158-
//move bar with mouse wheel
158+
// move bar with mouse wheel
159159
delta = bar.position().top + y * wheelStep;
160160

161-
//move bar, make sure it doesn't go out
161+
// move bar, make sure it doesn't go out
162162
delta = Math.max(delta, 0);
163163
var maxTop = me.outerHeight() - bar.outerHeight();
164164
delta = Math.min(delta, maxTop);
165165

166-
//scroll the scrollbar
166+
// scroll the scrollbar
167167
bar.css({ top: delta + 'px' });
168168
}
169169

170-
//calculate actual scroll amount
170+
// calculate actual scroll amount
171171
var percentScroll = parseInt(bar.position().top) / (me.outerHeight() - bar.outerHeight());
172172
delta = percentScroll * (me[0].scrollHeight - me.outerHeight());
173173

@@ -178,10 +178,10 @@
178178
bar.css({ top: offsetTop + 'px' });
179179
}
180180

181-
//scroll content
181+
// scroll content
182182
me.scrollTop(delta);
183183

184-
//ensure bar is visible
184+
// ensure bar is visible
185185
showBar();
186186

187187
// trigger hide when scroll is stopped
@@ -201,28 +201,28 @@
201201
}
202202
}
203203

204-
//attach scroll events
204+
// attach scroll events
205205
attachWheel();
206206

207207
var getBarHeight = function()
208208
{
209-
//calculate scrollbar height and make sure it is not too small
209+
// calculate scrollbar height and make sure it is not too small
210210
barHeight = Math.max((me.outerHeight() / me[0].scrollHeight) * me.outerHeight(), minBarHeight);
211211
bar.css({ height: barHeight + 'px' });
212212
}
213213

214-
//set up initial height
214+
// set up initial height
215215
getBarHeight();
216216

217217
var showBar = function()
218218
{
219-
//recalculate bar height
219+
// recalculate bar height
220220
getBarHeight();
221221
clearTimeout(queueHide);
222222

223-
//show only when required
223+
// show only when required
224224
if(barHeight >= me.outerHeight()) {
225-
//allow window scroll
225+
// allow window scroll
226226
releaseScroll = true;
227227
return;
228228
}
@@ -232,7 +232,7 @@
232232

233233
var hideBar = function()
234234
{
235-
//only hide when options allow it
235+
// only hide when options allow it
236236
if (!alwaysVisible)
237237
{
238238
queueHide = setTimeout(function(){
@@ -245,24 +245,24 @@
245245
}
246246
}
247247

248-
//check start position
248+
// check start position
249249
if (start == 'bottom')
250250
{
251-
//scroll content to bottom
251+
// scroll content to bottom
252252
bar.css({ top: 'auto', bottom: 0 });
253253
scrollContent(0, true);
254254
}
255255
else if (typeof start == 'object')
256256
{
257-
//scroll content
257+
// scroll content
258258
scrollContent($(start).position().top, null, true);
259259

260-
//make sure bar stays hidden
260+
// make sure bar stays hidden
261261
if (!alwaysVisible) { bar.hide(); }
262262
}
263263
});
264264

265-
//maintain chainability
265+
// maintain chainability
266266
return this;
267267
}
268268
});

0 commit comments

Comments
 (0)