Skip to content

Commit

Permalink
Merge pull request #3836 from IgniteUI/api-dropdown-links-7.1.x
Browse files Browse the repository at this point in the history
fix(api-dropdown): change option links and diversify the sessionStorage
  • Loading branch information
zdrawku authored Feb 6, 2019
2 parents 1ad8515 + 0493ea4 commit c2214b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,25 @@
}).done((data) => {
let folders = data.folders;
const select = $('#versions');
const lastVersion = folders.slice(-1)[0];

folders = folders.reverse();

folders.forEach(f => {
select.append($('<option>', {
value: `${baseUrl}/angular-docs/${f}/sass`,
value: `${baseUrl}/products/ignite-ui-angular/docs/${f}/sass`,
text: f
}));
});

select.val(`${baseUrl}/angular-docs/${lastVersion}/sass`);
select.val(`${baseUrl}/products/ignite-ui-angular/docs/${folders[0]}/sass`);

if (sessionStorage.apiVersion) {
select.val(sessionStorage.apiVersion);
if (sessionStorage.sassOption) {
select.val(sessionStorage.sassOption);
}
});

$('#versions').on('change', (...rest) => {
const val = $('#versions').val();
sessionStorage.apiVersion = val;
sessionStorage.sassOption = val;
window.location.assign(val);
});
})();
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,25 @@
}).done((data) => {
let folders = data.folders;
const select = $('#versions')
const lastVersion = folders.slice(-1)[0];

folders = folders.reverse();

folders.forEach(f => {
select.append($('<option>', {
value: `${baseUrl}/angular-docs/${f}/typescript`,
value: `${baseUrl}/products/ignite-ui-angular/docs/${f}/typescript`,
text: f
}));
});

select.val(`${baseUrl}/angular-docs/${lastVersion}/typescript`);
select.val(`${baseUrl}/products/ignite-ui-angular/docs/${folders[0]}/typescript`);

if (sessionStorage.apiVersion) {
select.val(sessionStorage.apiVersion);
if (sessionStorage.typedocOption) {
select.val(sessionStorage.typedocOption);
}
});

$('#versions').on('change', (...rest) => {
const val = $('#versions').val();
sessionStorage.apiVersion = val;
sessionStorage.typedocOption = val;
window.location.assign(val);
});
})();

0 comments on commit c2214b0

Please sign in to comment.