adapt_framework icon indicating copy to clipboard operation
adapt_framework copied to clipboard

Improvement for Adapt.device.screenSize

Open nilslp opened this issue 11 years ago • 4 comments

At the moment Adapt.device.screenSize only returns a value of 'small', 'medium', or 'large'.

However, this is only the width of the screen, it has no reference to the height of the screen and from a design aspect this would be very beneficial.

If it could be improved so that there was a Adapt.device.screenHeight and Adapt.device.screenWidth or Adapt.device.screenSizeHeight and Adapt.device.screenSizeWidth with Adapt.device.screenSize being left untouched as not to break any previous usage.

nilslp avatar Apr 29 '15 11:04 nilslp

Isn't this data already available via window.innerHeight and window.innerWidth?

moloko avatar Jul 23 '15 13:07 moloko

This is quite an old issue(!) but yes, given that Adapt assumes no particular height restrictions (hence allows scrolling) the screenSize measure needs only relate to width. In reality it is a simplified metric used to determine whether the device is 'desktop', 'tablet' or 'mobile' (hence its values are, respectively, large, medium, small).

chris-steele avatar Aug 23 '16 15:08 chris-steele

Maybe Adapt.device.orientation would help? Most devices are somewhere between 3:4 and 9:16 so you could deduce the approximate height from the aspect ratio?

andrewhosgood avatar Aug 25 '16 09:08 andrewhosgood

see https://github.com/adaptlearning/adapt_framework/commit/97f5ce46b93a8d66f5d54269177bbfcba2522179

moloko avatar Nov 28 '16 15:11 moloko