Skip to content

Commit

Permalink
Fixed Install page history broken (apache#18182)
Browse files Browse the repository at this point in the history
* fix install option block history broke

* when history goes back, avoid button default css blue outline

* use appropriate parameter name

* format scss change
  • Loading branch information
Yang Shi authored and ys2843 committed Sep 8, 2020
1 parent 0e86a91 commit 2f25012
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/static_site/src/_sass/minima/_getting_started.scss
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ ul.dropdown-content {
background-color: $color-mxnet;
color: $grey-color-light;
}

&:focus {
outline: 0;
}

}


Expand Down
7 changes: 5 additions & 2 deletions docs/static_site/src/assets/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $(document).ready(function () {
}
}

function setSelects(urlParams) {
function setSelects(urlParams, dontPushState) {
let queryString = '?';
$('button.opt').removeClass('active');
if (urlParams.get('version')) {
Expand Down Expand Up @@ -87,7 +87,7 @@ $(document).ready(function () {

showContent();

if (window.location.href.indexOf("/get_started") >= 0) {
if (window.location.href.indexOf("/get_started") >= 0 && !dontPushState) {
history.pushState(null, null, queryString);
}
}
Expand Down Expand Up @@ -129,5 +129,8 @@ $(document).ready(function () {
$('.opt-group').on('click', '.opt', setContent);
$('.install-widget').css("visibility", "visible");
$('.install-content').css("visibility", "visible");
$(window).on('popstate', function(){
setSelects(urlSearchParams(window.location.search), true);
});

});

0 comments on commit 2f25012

Please sign in to comment.