Skip to content

Commit

Permalink
"Unobtrusive" floating scroll bar
Browse files Browse the repository at this point in the history
Expand ESLint rules
Add contributing guidelines
  • Loading branch information
Amphiluke committed Oct 7, 2017
1 parent 0001af0 commit 5c1afe2
Show file tree
Hide file tree
Showing 11 changed files with 1,469 additions and 56 deletions.
103 changes: 103 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,124 @@
},
"extends": "eslint:recommended",
"rules": {
"array-bracket-spacing": [
"error"
],
"block-spacing": [
"error",
"never"
],
"brace-style": [
"error",
"1tbs"
],
"comma-spacing": [
"error"
],
"comma-style": [
"error"
],
"curly": [
"error"
],
"dot-location": [
"error",
"property"
],
"dot-notation": [
"error"
],
"eqeqeq": [
"error"
],
"func-call-spacing": [
"error"
],
"indent": [
"error",
4
],
"key-spacing": [
"error"
],
"keyword-spacing": [
"error"
],
"linebreak-style": [
"error",
"unix"
],
"new-cap": [
"warn"
],
"new-parens": [
"error"
],
"no-multi-spaces": [
"error"
],
"no-trailing-spaces": [
"warn"
],
"no-unneeded-ternary": [
"warn"
],
"no-useless-call": [
"error"
],
"no-whitespace-before-property": [
"warn"
],
"object-curly-spacing": [
"error"
],
"operator-assignment": [
"warn"
],
"operator-linebreak": [
"error",
"after"
],
"quotes": [
"error",
"double"
],
"rest-spread-spacing": [
"error"
],
"semi": [
"error",
"always"
],
"semi-spacing": [
"error"
],
"semi-style": [
"error"
],
"space-before-blocks": [
"error"
],
"space-before-function-paren": [
"error",
{"anonymous": "always", "named": "never", "asyncArrow": "always"}
],
"space-in-parens": [
"error"
],
"space-infix-ops": [
"error"
],
"space-unary-ops": [
"error"
],
"spaced-comment": [
"warn",
"always",
{"markers": ["!"]}
],
"switch-colon-spacing": [
"error"
]
}
}
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contributing to floating-scroll

## Reporting an issue

If you have found a bug please feel free to report an issue after ensuring that there is no such bug yet (check [existing issues](https://github.com/Amphiluke/floating-scroll/issues) first). Be sure to write a clear description of the problem. It will be great if you also provide a minimum example revealing the bug. You may use such services as [JSFiddle](https://jsfiddle.net/) and [RawGit](https://rawgit.com/) to assemble a live demo for the issue you found.

## Making changes in code and opening a pull request

If you know the way to fix some bug or just to make the plugin better then you are welcome to open a pull request. Please provide a clear and detailed description of what do your changes fix or improve, or refer an existing issue containing such an explanation.

Before submitting a new pull request be sure to do the following things.

* Ensure that your changes do not break existing features.
* Test your changes in different browsers: Chrome, Firefox, Safari, Opera, Internet Explorer, and Edge.
* Note that the plugin is currently compatible with ancient versions of jQuery (1.4.3+). If your changes break this compatibility please think if you can rewrite your code to keep compatibility unaffected. However if your changes are so important and cool that they outweigh all benefits of supporting ancient versions of jQuery then it is possible to soften this requirement within reasonable limits.
* Before committing your changes please make sure that the plugin sources pass ESLint checks. Just use the command `npm run lint` in the project directory (of course, you need to install the project first by executing `npm install`). Fix any problems reported by ESLint before submitting a pull request.
* Do not forget to update the minified version of the plugin sources. Use the command `npm run minify` for that. If you changed the file of plugin styles (`jquery.floatingscroll.less`) run `npm run make-css` to update the minified CSS file as well.

Thanks for contribution! :simple_smile:

Amphiluke
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ $(".spacious-container").floatingScroll();

The plugin's CSS provides some basic styles for elements with classes `.fl-scrolls-viewport` and `.fl-scrolls-body`. Feel free to adjust their styles in your stylesheets as needed.

### Tips

You can also make a floating scroll bar more “unobtrusive” so that it will appear only when the mouse pointer hovers over the scrollable container. To do so just apply the class `fl-scrolls-hoverable` to the desired scrollable container owning the floating scroll bar.

## Live demos

You may find some demos of use the floatingScroll plugin [here](https://amphiluke.github.io/floating-scroll/).
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"jquery-plugin",
"ecosystem:jquery"
],
"homepage": "http://amphiluke.github.io/floating-scroll/",
"homepage": "https://amphiluke.github.io/floating-scroll/",
"repository": {
"type": "git",
"url": "git://github.com/Amphiluke/floating-scroll.git"
Expand Down
4 changes: 2 additions & 2 deletions floating-scroll.jquery.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "floating-scroll",
"title": "floatingScroll",
"version": "2.3.1",
"version": "2.3.2",
"description": "A lightweight jQuery plugin providing floating scrollbar functionality",
"keywords": [
"scrollbar",
Expand All @@ -11,7 +11,7 @@
"author": "Amphiluke",
"license": "MIT",
"bugs": "https://github.com/Amphiluke/floating-scroll/issues",
"homepage": "https://github.com/Amphiluke/floating-scroll",
"homepage": "https://amphiluke.github.io/floating-scroll/",
"docs": "https://github.com/Amphiluke/floating-scroll#readme",
"download": "https://github.com/Amphiluke/floating-scroll/archive/master.zip",
"dependencies": {
Expand Down
Loading

0 comments on commit 5c1afe2

Please sign in to comment.