Skip to content

Commit

Permalink
Fix for data attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
HTMLGuyLLC committed Sep 10, 2019
1 parent bb5c434 commit e9e5799
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ $('.social-share').jConfirm({
]
}).on('facebook-share', function(e, data){
var btn = $(this);
var data_attr = btn.data('some_data_attr'); //1
var data_attr = data.some_data_attr; //1
console.log('Sharing to facebook: '+btn.data('url-to-share'));
}).on('twitter-share', function(e, data){
var btn = $(this);
var data_attr = btn.data('some_data_attr'); //2
var data_attr = data.some_data_attr; //2
console.log('Sharing to twitter: '+btn.data('url-to-share'));
});
```
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,17 @@ <h4>Social Media Sharing:</h4>
class:'twitter-btn'
}
]
}).on('facebook-share', function(e){
}).on('facebook-share', function(e, data){
var btn = $(this);
var data_attr = btn.data('some_data_attr'); //1
var data_attr = data.some_data_attr; //1
var url = 'http://www.facebook.com/sharer.php?u='+btn.data('url-to-share');
window.open(
url,
'_blank'
);
}).on('twitter-share', function(e){
}).on('twitter-share', function(e, data){
var btn = $(this);
var data_attr = btn.data('some_data_attr'); //2
var data_attr = data.some_data_attr; //2
var url = 'http://twitter.com/share?text=This%20is%20the%20best!&url='+btn.data('url-to-share');
window.open(
url,
Expand Down
2 changes: 1 addition & 1 deletion jConfirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
e.preventDefault();
const btn = $(this);
//trigger event
helper.dom_wrapped.trigger(btn.data('event'));
helper.dom_wrapped.trigger(btn.data('event'), btn.data());
//hide helper
helper.hide();
//follow href
Expand Down
2 changes: 1 addition & 1 deletion jConfirm.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jconfirm",
"version": "4.5.1",
"version": "4.5.2",
"description": "jQuery confirmation tooltip plugin",
"author": {
"name" : "HTMLGuy, LLC",
Expand Down

0 comments on commit e9e5799

Please sign in to comment.