Skip to content
This repository has been archived by the owner on Apr 12, 2019. It is now read-only.

Commit

Permalink
2.4.1 - Switch hash tab switching. Target mobile. Remove deprecated f…
Browse files Browse the repository at this point in the history
…iles.
  • Loading branch information
Alexia committed Jan 24, 2018
1 parent a499360 commit 7b302a2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 82 deletions.
35 changes: 0 additions & 35 deletions Tabber.i18n.php

This file was deleted.

44 changes: 0 additions & 44 deletions Tabber.php

This file was deleted.

8 changes: 6 additions & 2 deletions extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Tabber",
"version": "2.4",
"version": "2.4.1",
"author": [
"Eric Fortin",
"Alexia E. Smith"
Expand All @@ -14,7 +14,7 @@
]
},
"AutoloadClasses": {
"TabberHooks": "/Tabber.hooks.php"
"TabberHooks": "Tabber.hooks.php"
},
"ResourceModules": {
"ext.Tabber": {
Expand All @@ -23,6 +23,10 @@
],
"scripts": [
"js/tabber.js"
],
"targets": [
"desktop",
"mobile"
]
}
},
Expand Down
16 changes: 15 additions & 1 deletion js/tabber.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,26 @@
e.preventDefault();
if ( history.pushState ) {
history.pushState( null, null, '#' + title );
switchTab(title);
} else {
location.hash = '#' + title;
}
showContent( title );
} );

$(window).on('hashchange', function(event) {
switchTab(event);
});

function switchTab(event) {
var tab = location.hash.replace('#', '');
if (!tab.length) {
showContent(tabContent.first().attr('title'));
}
if (nav.find('a[title="'+tab+'"]').length) {
showContent(tab);
}
}

$this.addClass( 'tabberlive' );
} );
};
Expand Down

0 comments on commit 7b302a2

Please sign in to comment.