From da72d83087482cb5d2184f4d1d1eaa9a7a838e04 Mon Sep 17 00:00:00 2001 From: Rocco Howard Date: Wed, 3 Aug 2016 20:47:24 +1000 Subject: [PATCH 1/4] Added option to change the show tab behaviour Issue - showing the tab doesn't trigger any applied behaviours. Based on a new option as to not change current behaviour, this change changes from using a tab('show') to a trigger('click') which would then set off any behaviours that have been set against the click. --- jquery.stickytabs.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jquery.stickytabs.js b/jquery.stickytabs.js index a1a653e..e0f1b27 100644 --- a/jquery.stickytabs.js +++ b/jquery.stickytabs.js @@ -11,6 +11,7 @@ var settings = $.extend({ getHashCallback: function(hash, btn) { return hash }, selectorAttribute: "href", + showTabUsingClickTrigger: false, backToTop: false, initialTab: $('li.active > a', context) }, options ); @@ -20,7 +21,11 @@ var hash = settings.selectorAttribute == "href" ? window.location.hash : window.location.hash.substring(1); if (hash != '') { var selector = hash ? 'a[' + settings.selectorAttribute +'="' + hash + '"]' : settings.initialTab; - $(selector, context).tab('show'); + if (settings.showTabUsingClickTrigger === true) { + $(selector, context).trigger('click'); + } else { + $(selector, context).tab('show'); + } setTimeout(backToTop, 1); } } From 106443eb7f1190ccabe951aed5dc5b5233376ccc Mon Sep 17 00:00:00 2001 From: Rocco Howard Date: Wed, 3 Aug 2016 21:17:43 +1000 Subject: [PATCH 2/4] Added showTabUsingClickTrigger option to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0c9adbf..1386631 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ $(function() { |------|-------|-----------| | selectorAttribute | false | Override the default `href` attribute used as selector when you need to activate multiple TabPanels at once with a single Tab using the `data-target` attribute. | | backToTop |false | Prevent the page from jumping down to the tab content by setting the backToTop setting to true. | +| showTabUsingClickTrigger |false | Activate the requeted tab using the click trigger so that any behaviours on the click trigger are activated. | NuGet package ============= From 3603aaa699ff7d5564a37fa0ecc23f471da2d07d Mon Sep 17 00:00:00 2001 From: Rocco Howard Date: Wed, 3 Aug 2016 21:18:12 +1000 Subject: [PATCH 3/4] Updated version --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 2e5e3c9..b9e3b27 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "jquery-stickytabs", - "version": "1.2.3", + "version": "1.2.5", "homepage": "https://github.com/aidanlister/jquery-stickytabs", "authors": [ "Aidan Lister " From fe9c115de4f1670ad57bff2be412e228d2df4548 Mon Sep 17 00:00:00 2001 From: Rocco Howard Date: Wed, 3 Aug 2016 21:18:28 +1000 Subject: [PATCH 4/4] Updated version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dac6ebd..315c3da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jquery-stickytabs", - "version": "1.2.3", + "version": "1.2.5", "description": "jquery-stickytabs =================", "main": "jquery.stickytabs.js", "directories": {