Skip to content

Commit

Permalink
Modified mobile detection for on resize check
Browse files Browse the repository at this point in the history
  • Loading branch information
ravstamper committed Dec 18, 2019
1 parent ad99a91 commit 43c3228
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions taino.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class taino{
var t =this;
if(typeof(resizeTimer)!='undefined'){ clearTimeout(resizeTimer); }
resizeTimer = setTimeout(function() {
if(taino.ismobile()){
if(taino.ismobile() ===false){
t.loadtemplate();
t.update();
}
Expand Down Expand Up @@ -162,7 +162,7 @@ class taino{
this.currentpage = this.getcurrent(path);
this.loadScript(this.jspath+this.currentpage+'.js').then(()=>{
this.loadcontent();
window.scrollTo(0,0);
window.scrollTo(0,0);
});
}

Expand Down Expand Up @@ -247,9 +247,7 @@ class taino{

static ismobile() {
var useragent = navigator.userAgent;
if(useragent.match(/Android/i)||
useragent.match(/iPhone/i)||
useragent.match(/iPad/i)) {
if(useragent.match(/Android|iPhone|iPad/i)){
return true;
} else {
return false;
Expand Down

0 comments on commit 43c3228

Please sign in to comment.