Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/css/nanoscroller.less
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
}
}

.@{nanoClass}:hover > .@{paneClass},
.@{nanoClass}.hover > .@{paneClass},
.@{paneClass}.active,
.@{paneClass}.flashed {
/* Target only IE7 and IE8 with this hack */
Expand Down
32 changes: 24 additions & 8 deletions bin/javascripts/jquery.nanoscroller.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/javascripts/jquery.nanoscroller.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bin/javascripts/jquery.nanoscroller.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/javascripts/jquery.nanoscroller.min.js.map

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions bin/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,21 @@ <h4 id="contentclass">contentClass</h4>
<p><strong>Default:</strong> &#39;nano-content&#39;</p>
<pre><code class="lang-js">$(&quot;.nano&quot;).nanoScroller({ contentClass: &#39;sliderContent&#39; });
</code></pre>
<h4 id="enabledclass">enabledClass</h4>
<p>A classname for scrollbar enabled mode. If you change this setting, you also have to change it in the plugin&#39;s CSS file.</p>
<p><strong>Default:</strong> &#39;has-scrollbar&#39;</p>
<pre><code class="lang-js">$(&quot;.nano&quot;).nanoScroller({ enabledClass: &#39;__enabled&#39; });
</code></pre>
<h4 id="flashedclass">flashedClass</h4>
<p>A classname for scrollbar flashed mode. If you change this setting, you also have to change it in the plugin&#39;s CSS file.</p>
<p><strong>Default:</strong> &#39;flashed&#39;</p>
<pre><code class="lang-js">$(&quot;.nano&quot;).nanoScroller({ flashedClass: &#39;__flashed&#39; });
</code></pre>
<h4 id="activeclass">activeClass</h4>
<p>A classname for scrollbar active mode. If you change this setting, you also have to change it in the plugin&#39;s CSS file.</p>
<p><strong>Default:</strong> &#39;active&#39;</p>
<pre><code class="lang-js">$(&quot;.nano&quot;).nanoScroller({ activeClass: &#39;__active&#39; });
</code></pre>
<h4 id="tabindex">tabIndex</h4>
<p>Set the tab order of the scrollable content. Set to -1 to skip over the scrollable content when tabbing.</p>
<p><strong>Default:</strong> 0</p>
Expand Down
23 changes: 22 additions & 1 deletion coffeescripts/jquery.nanoscroller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@
###
MOUSEENTER = 'mouseenter'

###*
@property MOUSELEAVE
@type String
@final
@private
###
MOUSELEAVE = 'mouseleave'

###*
@property MOUSEMOVE
@type String
Expand Down Expand Up @@ -440,6 +448,10 @@
###
updateScrollValues: ->
content = @content

# Prevent horizontal scrolling
content.scrollLeft = 0

# Formula/ratio
# `scrollTop / maxScrollTop = sliderTop / maxSliderTop`
@maxScrollTop = content.scrollHeight - content.clientHeight
Expand Down Expand Up @@ -567,6 +579,12 @@
return unless @isBeingDragged
@events[UP] arguments... if (e.buttons or e.which) isnt 1

mouseenter: (e) =>
@$el.addClass('hover')

mouseleave: (e) =>
@$el.removeClass('hover')

return

###*
Expand All @@ -588,6 +606,8 @@
.bind("#{MOUSEWHEEL} #{DOMSCROLL}", events[WHEEL])
@$content
.bind("#{SCROLL} #{MOUSEWHEEL} #{DOMSCROLL} #{TOUCHMOVE}", events[SCROLL])
.bind(MOUSEENTER, events[MOUSEENTER])
.bind(MOUSELEAVE, events[MOUSELEAVE])
return

###*
Expand All @@ -604,6 +624,8 @@
do @pane.unbind
@$content
.unbind("#{SCROLL} #{MOUSEWHEEL} #{DOMSCROLL} #{TOUCHMOVE}", events[SCROLL])
.unbind(MOUSEENTER, events[MOUSEENTER])
.unbind(MOUSELEAVE, events[MOUSELEAVE])
return

###*
Expand Down Expand Up @@ -632,7 +654,6 @@
right: -14
paddingRight: +currentPadding + 14
else if BROWSER_SCROLLBAR_WIDTH
cssRule = right: -BROWSER_SCROLLBAR_WIDTH
@$el.addClass options.enabledClass

@$content.css cssRule if cssRule?
Expand Down