Skip to content

Commit

Permalink
Merge pull request #79 from QuickCorp/v2.3
Browse files Browse the repository at this point in the history
Implement getDocumentLayout() possible values are: portrait, landscap…
  • Loading branch information
jeanmachuca committed Jul 18, 2021
2 parents 2491c92 + 7d9e8d7 commit 7799ea8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions QCObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -3650,6 +3650,23 @@
String.prototype.list = function () { var __instance=this; return _top.range(0,__instance.length-1).map( function (i) {return __instance[i];}); };
(_protected_code_)(String.prototype.list);

_top.getDocumentLayout = function () {
var h = (w, h) => {
return w>h ? "landscape": null;
};
var v = (w, h) => {
return h>w ? "portrait": null;
};
var square = (w, h) => {
return w===h ? "square": null;
};
return [
h(document.documentElement.clientWidth,document.documentElement.clientHeight),
v(document.documentElement.clientWidth,document.documentElement.clientHeight),
square(document.documentElement.clientWidth,document.documentElement.clientHeight)
].filter(e=>e!==null).pop();
};


/**
* End of array math functions
Expand Down

0 comments on commit 7799ea8

Please sign in to comment.