Skip to content

Commit

Permalink
Reworked setOptions to allow settingsBreakpoint to perform
Browse files Browse the repository at this point in the history
the extension of the options

This closes issue #27
  • Loading branch information
NickPiscitelli committed Dec 27, 2018
1 parent 7410338 commit d9cd978
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions docs/assets/js/glider.min.js

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

11 changes: 5 additions & 6 deletions glider.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
\___//_//_/ \_,_/ \__//_/ (_)__/ //___/
|___/
Version: 1.6.1
Version: 1.6.2
Author: Nick Piscitelli (pickykneee)
Website: https://nickpiscitelli.com
Documentation: http://nickpiscitelli.github.io/Glider.js
Expand Down Expand Up @@ -470,19 +470,18 @@
gliderPrototype.setOption = function (opt, global) {
var _ = this

if (_.breakpoint) {
if (_.breakpoint && !global) {
_._opt.responsive.forEach(function (v) {
if (v.breakpoint === _.breakpoint) {
v.settings = Object.assign({}, v.settings, opt)
}
})
}

if (!_.breakpoint || global) {
} else {
_._opt = Object.assign({}, _._opt, opt)
}

_.opt = Object.assign({}, _.opt, opt)
_.breakpoint = 0
_.settingsBreakpoint()
}

gliderPrototype.destroy = function () {
Expand Down
Loading

0 comments on commit d9cd978

Please sign in to comment.