mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Detect if mobile layout is used and display wallets accordingly (thanks @harding)
This commit is contained in:
parent
851e146230
commit
90b9e63026
4 changed files with 19 additions and 3 deletions
10
js/main.js
10
js/main.js
|
@ -93,6 +93,12 @@ function getWindowX(){
|
|||
return (window.innerWidth)?window.innerWidth:document.documentElement.clientWidth;
|
||||
}
|
||||
|
||||
function isMobile(){
|
||||
//Return true if the mobile CSS stylesheet is used.
|
||||
if(getStyle(document.getElementById('detectmobile'),'display')!='none')return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function addClass(node,data){
|
||||
//Add class to node.
|
||||
var cl=node.className.split(' ');
|
||||
|
@ -420,8 +426,8 @@ if(t.parentNode.parentNode.parentNode.nodeName!='DIV'){
|
|||
t.setAttribute('data-select','1');
|
||||
addClass(t.parentNode,'select');
|
||||
}
|
||||
if(getStyle(document.getElementById('walletsmobile'),'display')!='none'){
|
||||
if(t.parentNode.getElementsByTagName('UL').length==0)setTimeout(function(){scrollToNode(document.getElementById('wallets'));},10);
|
||||
if(isMobile()&&t.parentNode.getElementsByTagName('UL').length==0){
|
||||
setTimeout(function(){scrollToNode(document.getElementById('wallets'));},10);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue