Skip to content

Commit

Permalink
Default parameters setting within jQuery.fn.easyOverlay.options
Browse files Browse the repository at this point in the history
  • Loading branch information
nenomaz committed Nov 19, 2016
1 parent 39e4033 commit a6d393b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@

### 2.3.1 (Nov 7, 2016)
* ZIndex on the container was not set, bug fixed

### 2.3.2 (Nov 19, 2016)
* Now, default parameters can be set within jQuery.fn.easyOverlay.options
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,16 @@ That's all!
Options
---------
To customize some aspects of the plugin behaviour, you can pass an object as a second parameter.
To customize some aspects of the plugin behaviour, you can use options. Defaults are:
```
{
zindex: "99999",
spin: true,
delay: 400
}
```
You can pass an object as a second parameter.
```javascript
$("#elementDesired").easyOverlay("start", {
Expand All @@ -48,5 +57,12 @@ $("#elementDesired").easyOverlay("start", {
delay: 200 //Time in miliseconds for the fadeIn or fadeOut effects of the overlay.
});
```
And set your default values, for all calls of easyOverlay, without passing arguments:
```javascript
jQuery.fn.easyOverlay.options = { /* Here your options */ };
```
**Note**:
* When using the `stop` option, actually only the `delay` parameter will be relevant;
* Options passed as arguments will override those setted within jQuery.fn.easyOverlay.options property;
**Note**: When using the `stop` option, actually only the `delay` parameter will be relevant.
2 changes: 1 addition & 1 deletion jquery.easy-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ along with jQuery Easy Overlay. If not, see <http://www.gnu.org/licenses/>.
delay: 400,
};

var _options = $.extend({}, defaults, options || {});
var _options = $.extend(true, defaults, $.fn.easyOverlay.options || {}, options || {});
var overlayZIndex;
$.fn.easyOverlay.indexCounter++;

Expand Down

0 comments on commit a6d393b

Please sign in to comment.