From bf241baee748a4af542cdb55317a48b23e617e94 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Tue, 1 Sep 2020 13:27:03 -0600 Subject: [PATCH] Fix handling some target values for linkable tabs. Replaces #5257 --- modules/system/assets/ui/js/tab.js | 2 +- modules/system/assets/ui/storm-min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/system/assets/ui/js/tab.js b/modules/system/assets/ui/js/tab.js index da11f553a..6de904055 100644 --- a/modules/system/assets/ui/js/tab.js +++ b/modules/system/assets/ui/js/tab.js @@ -89,7 +89,7 @@ this.updateClasses() if (location.hash && this.$tabsContainer.is('[data-linkable]')) { - $('li > a[href=' + location.hash + ']', this.$tabsContainer).tab('show') + $('li > a[href="' + location.hash + '"]', this.$tabsContainer).tab('show') } } diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js index e5b26e6a0..e5bf9a051 100644 --- a/modules/system/assets/ui/storm-min.js +++ b/modules/system/assets/ui/storm-min.js @@ -4597,7 +4597,7 @@ if(tabUrl){window.history.replaceState({},'Tab link reference',tabUrl)}}) if(this.options.slidable){this.$pagesContainer.touchwipe({wipeRight:function(){self.prev();},wipeLeft:function(){self.next();},preventDefaultEvents:false,min_move_x:60});} this.$tabsContainer.toolbar({scrollClassContainer:this.$el}) this.updateClasses() -if(location.hash&&this.$tabsContainer.is('[data-linkable]')){$('li > a[href='+location.hash+']',this.$tabsContainer).tab('show')}} +if(location.hash&&this.$tabsContainer.is('[data-linkable]')){$('li > a[href="'+location.hash+'"]',this.$tabsContainer).tab('show')}} Tab.prototype.initTab=function(li){var $tabs=$('>li',this.$tabsContainer),tabIndex=$tabs.index(li),time=new Date().getTime(),targetId=this.tabId+'-tab-'+tabIndex+time,$anchor=$('a',li) $anchor.data('target','#'+targetId).attr('data-target','#'+targetId).attr('data-toggle','tab')