| Conditions | 1 |
| Paths | 1 |
| Total Lines | 35 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | (function($) { |
||
| 2 | var syncTabs = function(lang) { |
||
| 3 | $('.localized-fields-widget.tab a:contains("'+lang+'")').each(function(){ |
||
| 4 | $(this).parents('.localized-fields-widget[role="tabs"]').find('.localized-fields-widget.tab').removeClass('active'); |
||
| 5 | $(this).parents('.localized-fields-widget.tab').addClass('active'); |
||
| 6 | $(this).parents('.localized-fields-widget[role="tabs"]').children('.localized-fields-widget [role="tabpanel"]').hide(); |
||
| 7 | $($(this).attr('href')).show(); |
||
| 8 | }); |
||
| 9 | } |
||
| 10 | |||
| 11 | $(function (){ |
||
| 12 | $('.localized-fields-widget [role="tabpanel"]').hide(); |
||
| 13 | // set first tab as active |
||
| 14 | $('.localized-fields-widget[role="tabs"]').each(function () { |
||
| 15 | $(this).find('.localized-fields-widget.tab:first').addClass('active'); |
||
| 16 | $($(this).find('.localized-fields-widget.tab:first a').attr('href')).show(); |
||
| 17 | }); |
||
| 18 | // try set active last selected tab |
||
| 19 | if (window.sessionStorage) { |
||
| 20 | var lang = window.sessionStorage.getItem('localized-field-lang'); |
||
| 21 | if (lang) { |
||
| 22 | syncTabs(lang); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | $('.localized-fields-widget.tab a').click(function(event) { |
||
| 27 | event.preventDefault(); |
||
| 28 | syncTabs(this.innerText); |
||
| 29 | if (window.sessionStorage) { |
||
| 30 | window.sessionStorage.setItem('localized-field-lang', this.innerText); |
||
| 31 | } |
||
| 32 | return false; |
||
| 33 | }); |
||
| 34 | }); |
||
| 35 | })(django.jQuery) |
||
|
|
|||
| 36 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.