From f9bd2d40254edfc38d0bfa9ca10ffc4c54c400ab Mon Sep 17 00:00:00 2001 From: "Sergei Kalugin (Work iMac)" Date: Tue, 25 Apr 2017 11:54:58 -0500 Subject: [PATCH] Move function declaration out of the nested structure. --- jquery.tabslet.js | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/jquery.tabslet.js b/jquery.tabslet.js index 26df420..b197fab 100644 --- a/jquery.tabslet.js +++ b/jquery.tabslet.js @@ -174,26 +174,6 @@ } - function deep_link() { - - var ids = []; - - elements.find('a').each(function() { ids.push($(this).attr($this.opts.attribute)); }); - - var index = $.inArray(location.hash, ids) - - if (index > -1) { - - return index + 1 - - } else { - - return ($this.data('active') || options.active) - - } - - } - var move = function(direction) { if (direction == 'forward') i = ++i % elements.length; // wrap around @@ -241,6 +221,21 @@ }; + function deep_link() { + + var ids = []; + + elements.find('a').each(function() { ids.push($(this).attr($this.opts.attribute)); }); + + var index = $.inArray(location.hash, ids); + + if (index > -1) { + return index + 1 + } else { + return ($this.data('active') || options.active) + } + } + $(document).ready(function () { $('[data-toggle="tabslet"]').tabslet(); }); })(jQuery);