Skip to content

Commit

Permalink
Fix SetDeviceBreakpoints behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
OS-giulianasilva committed Nov 10, 2023
1 parent 3187388 commit 009347f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
12 changes: 6 additions & 6 deletions dist/OutSystemsUI.css
Original file line number Diff line number Diff line change
Expand Up @@ -8508,10 +8508,10 @@ span.flatpickr-weekday{
color:var(--color-neutral-6);
pointer-events:none;
}
.osui-datepicker input.flatpickr-input:first-of-type{
.osui-datepicker input:first-of-type{
display:none;
}
.osui-datepicker input.flatpickr-input:first-of-type{
.osui-datepicker input:first-of-type{
-servicestudio-display:inline-flex !important;
}
.osui-datepicker-calendar-ss-preview{
Expand Down Expand Up @@ -9599,10 +9599,10 @@ body.vscomp-popup-active .vscomp-wrapper{
color:var(--color-neutral-6);
pointer-events:none;
}
.osui-monthpicker input.flatpickr-input:first-of-type{
.osui-monthpicker input:first-of-type{
display:none;
}
.osui-monthpicker input.flatpickr-input:first-of-type{
.osui-monthpicker input:first-of-type{
-servicestudio-display:inline-flex !important;
}
.form .osui-monthpicker-ss-preview{
Expand Down Expand Up @@ -10465,10 +10465,10 @@ body.vscomp-popup-active .vscomp-wrapper{
color:var(--color-neutral-6);
pointer-events:none;
}
.osui-timepicker input.flatpickr-input:first-of-type{
.osui-timepicker input[type=time]:first-of-type{
display:none;
}
.osui-timepicker input.flatpickr-input:first-of-type{
.osui-timepicker input[type=time]:first-of-type{
-servicestudio-display:inline-flex !important;
}
.osui-timepicker__dropdown-ss-preview{
Expand Down
6 changes: 2 additions & 4 deletions dist/OutSystemsUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -16110,7 +16110,6 @@ var OutSystems;
const orient = windowWidth > windowHeight
? OSFramework.OSUI.GlobalEnum.DeviceOrientation.landscape
: OSFramework.OSUI.GlobalEnum.DeviceOrientation.portrait;
const isLandscape = orient === OSFramework.OSUI.GlobalEnum.DeviceOrientation.landscape;
const userValues = {
phone: phoneWidth,
tablet: tabletWidth,
Expand All @@ -16123,11 +16122,10 @@ var OutSystems;
OSFramework.OSUI.GlobalEnum.DeviceType.desktop,
];
let device;
const windowSize = isLandscape ? windowWidth : windowHeight;
if (windowSize <= phoneMax) {
if (windowWidth <= phoneMax) {
device = 0;
}
else if (windowSize <= tabletMax) {
else if (windowWidth <= tabletMax) {
device = 1;
}
else {
Expand Down
8 changes: 2 additions & 6 deletions src/scripts/OutSystems/OSUI/Utils/DeviceDetection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ namespace OutSystems.OSUI.Utils.DeviceDetection {
windowWidth > windowHeight
? OSFramework.OSUI.GlobalEnum.DeviceOrientation.landscape
: OSFramework.OSUI.GlobalEnum.DeviceOrientation.portrait;
const isLandscape = orient === OSFramework.OSUI.GlobalEnum.DeviceOrientation.landscape;

const userValues = {
phone: phoneWidth,
Expand All @@ -167,13 +166,10 @@ namespace OutSystems.OSUI.Utils.DeviceDetection {

let device;

// To set the device using the window dimensions, we just need to look into the largest dimension
const windowSize = isLandscape ? windowWidth : windowHeight;

if (windowSize <= phoneMax) {
if (windowWidth <= phoneMax) {
//Is phone!
device = 0;
} else if (windowSize <= tabletMax) {
} else if (windowWidth <= tabletMax) {
//Is Tablet!
device = 1;
} else {
Expand Down

0 comments on commit 009347f

Please sign in to comment.