-
Notifications
You must be signed in to change notification settings - Fork 8
Create Swiper module and component #390
base: dev
Are you sure you want to change the base?
Conversation
} | ||
}; | ||
|
||
var DATA_KEY = 'swpr'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use swiper
as a key ? or this is already taken by the lib ?
|
||
return { | ||
init: init, | ||
reset: reset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should include a destroy method
return config; | ||
}; | ||
|
||
var init = function (element) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our init methods always need a second params to add/override the default config of the swiper instence
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See flickity.js for reference
return obj; | ||
}; | ||
|
||
var getConfig = function (element, prefix) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the fx computeOptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't support nested options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will update computeOptions to support this. Still use it tho.
|
||
'use strict'; | ||
|
||
App.components.exports('swiper', function (s) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to override default config too via s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments above.
var nestedConfigs = [ | ||
'navigation', | ||
'scrollbar', | ||
'pagination', | ||
'thumbs', | ||
'autoplay', | ||
'keyboard' | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think that we should add all the Nested Configs available ? ex : mousewheel
If you think so, there's more that we can add ;)
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should define which one is added by default :)
@nitriques @fhamon @emmacharp @dominic-blain @fstgerm @alexnantel88 @f-elix @beaubbe
No description provided.