Skip to content

Commit

Permalink
demo docs. select correspondent with a hash button
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaipov committed Mar 26, 2019
1 parent 9eec247 commit 4b13585
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions docs/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@
}

function buttonLeave(button) {
if ("#" + button.dataset.hash === window.location.hash) {
return;
}
button.classList.remove('btn_transform');
const oppositeElement = getOppositeElementId(button);
oppositeElement.classList.remove('btn_transform');
Expand All @@ -356,8 +359,11 @@
document.getElementsByClassName('page-active')[0].classList.remove('page-active');
}
el.classList.add('page-active');
// const button = document.querySelector('.btn-command[data-hash=' + hash + ']');
// buttonEnter(document.getElementById(hash));
document.querySelectorAll('.btn_transform').forEach(function(button) {
button.classList.remove('btn_transform')
});
const button = document.querySelector('[data-hash=' + hash + '][data-left="1"]');
buttonEnter(button);

const request = fieldsToJson();
document.getElementById('request').value = JSON.stringify(request, undefined, 2);
Expand Down
10 changes: 8 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@
}

function buttonLeave(button) {
if ("#" + button.dataset.hash === window.location.hash) {
return;
}
button.classList.remove('btn_transform');
const oppositeElement = getOppositeElementId(button);
oppositeElement.classList.remove('btn_transform');
Expand All @@ -356,8 +359,11 @@
document.getElementsByClassName('page-active')[0].classList.remove('page-active');
}
el.classList.add('page-active');
// const button = document.querySelector('.btn-command[data-hash=' + hash + ']');
// buttonEnter(document.getElementById(hash));
document.querySelectorAll('.btn_transform').forEach(function(button) {
button.classList.remove('btn_transform')
});
const button = document.querySelector('[data-hash=' + hash + '][data-left="1"]');
buttonEnter(button);

const request = fieldsToJson();
document.getElementById('request').value = JSON.stringify(request, undefined, 2);
Expand Down

0 comments on commit 4b13585

Please sign in to comment.