* flare tag line height * . * . * . * . * specs * spec * . * init * . * . * js refactor * js * update spec * Fix infinite scroll * typo * move IF * pro analytics link fix * Clean up tests * Refactor adding of html Co-authored-by: benhalpern <bendhalpern@gmail.com>
25 lines
571 B
JavaScript
25 lines
571 B
JavaScript
/* global InstantClick */
|
|
|
|
'use strict';
|
|
|
|
function selectNavigation(select, urlPrefix) {
|
|
const trigger = document.getElementById(select);
|
|
|
|
if (trigger) {
|
|
trigger.addEventListener('change', (event) => {
|
|
let url = event.target.value;
|
|
if (urlPrefix) {
|
|
url = urlPrefix + url;
|
|
}
|
|
|
|
InstantClick.preload(url);
|
|
InstantClick.display(url);
|
|
});
|
|
}
|
|
}
|
|
|
|
function initializeDashboardSort() {
|
|
selectNavigation('dashboard_sort', '/dashboard?sort=');
|
|
selectNavigation('dashboard_author');
|
|
selectNavigation('mobile_nav_dashboard');
|
|
}
|