Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add data-trunk8-* support #44

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

add data-trunk8-* support #44

wants to merge 4 commits into from

Conversation

waitingmyself
Copy link

add attribute data-trunk8-* to each element for special settings
@rviscomi sorry for my english,i am uncertain if i understand your words

It should not take precedence over the options object in init.

the order of the config is :
trunk8.defaults -- trunk8 config -- element attribute
and the next will override the last

@@ -226,8 +226,18 @@
if (!data) {
$this.data('trunk8', (data = new trunk8(this)));
}

// add data-trunk8-* support
var elAttr = {};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer verbose name "elementAttributes"

@waitingmyself
Copy link
Author

@rviscomi thanks for your reply,and i have add a new commit to fix the problem.

@@ -226,6 +226,8 @@

methods = {
init: function (options) {
// data-trunk8-* config prefix
var trunk8DataAttributeName = 'data-trunk8-';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be moved into the return function with the other vars (elementAttributes, attributes).

format the script
@waitingmyself
Copy link
Author

thanks @rviscomi i learn much more than the code itself ~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants