Documentation ¶
Overview ¶
Package orientation provides the ability to read the screen orientation type and angle, to be informed when the screen orientation changes, and to lock the screen to a specific orientation.
Browser support on https://caniuse.com/#feat=screen-orientation
Index ¶
- type OrientationLockType
- type OrientationType
- type ScreenOrientation
- func (_this *ScreenOrientation) AddEventChange(listener func(event *domcore.Event, currentTarget *ScreenOrientation)) js.Func
- func (_this *ScreenOrientation) Angle() int
- func (_this *ScreenOrientation) Lock(orientation OrientationLockType) (_result *javascript.PromiseVoid)
- func (_this *ScreenOrientation) OnChange() domcore.EventHandlerFunc
- func (_this *ScreenOrientation) SetOnChange(listener func(event *domcore.Event, currentTarget *ScreenOrientation)) js.Func
- func (_this *ScreenOrientation) Type() OrientationType
- func (_this *ScreenOrientation) Unlock()
- type Union
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrientationLockType ¶
type OrientationLockType int
enum: OrientationLockType
const ( AnyOrientationLockType OrientationLockType = iota NaturalOrientationLockType LandscapeOrientationLockType PortraitOrientationLockType PortraitPrimaryOrientationLockType PortraitSecondaryOrientationLockType LandscapePrimaryOrientationLockType LandscapeSecondaryOrientationLockType )
func OrientationLockTypeFromJS ¶
func OrientationLockTypeFromJS(value js.Value) OrientationLockType
OrientationLockTypeFromJS is converting a javascript value into a OrientationLockType enum value.
func (*OrientationLockType) JSValue ¶
func (this *OrientationLockType) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (OrientationLockType) Value ¶
func (this OrientationLockType) Value() string
Value is converting this into javascript defined string value
type OrientationType ¶
type OrientationType int
enum: OrientationType
const ( PortraitPrimaryOrientationType OrientationType = iota PortraitSecondaryOrientationType LandscapePrimaryOrientationType LandscapeSecondaryOrientationType )
func OrientationTypeFromJS ¶
func OrientationTypeFromJS(value js.Value) OrientationType
OrientationTypeFromJS is converting a javascript value into a OrientationType enum value.
func (*OrientationType) JSValue ¶
func (this *OrientationType) JSValue() js.Value
JSValue is converting this enum into a javascript object
func (OrientationType) Value ¶
func (this OrientationType) Value() string
Value is converting this into javascript defined string value
type ScreenOrientation ¶
type ScreenOrientation struct {
domcore.EventTarget
}
class: ScreenOrientation
func ScreenOrientationFromJS ¶
func ScreenOrientationFromJS(value js.Wrapper) *ScreenOrientation
ScreenOrientationFromJS is casting a js.Wrapper into ScreenOrientation.
func (*ScreenOrientation) AddEventChange ¶
func (_this *ScreenOrientation) AddEventChange(listener func(event *domcore.Event, currentTarget *ScreenOrientation)) js.Func
AddChange is adding doing AddEventListener for 'Change' on target. This method is returning allocated javascript function that need to be released.
func (*ScreenOrientation) Angle ¶
func (_this *ScreenOrientation) Angle() int
Angle returning attribute 'angle' with type int (idl: unsigned short).
func (*ScreenOrientation) Lock ¶
func (_this *ScreenOrientation) Lock(orientation OrientationLockType) (_result *javascript.PromiseVoid)
func (*ScreenOrientation) OnChange ¶
func (_this *ScreenOrientation) OnChange() domcore.EventHandlerFunc
OnChange returning attribute 'onchange' with type domcore.EventHandler (idl: EventHandlerNonNull).
func (*ScreenOrientation) SetOnChange ¶
func (_this *ScreenOrientation) SetOnChange(listener func(event *domcore.Event, currentTarget *ScreenOrientation)) js.Func
SetOnChange is assigning a function to 'onchange'. This This method is returning allocated javascript function that need to be released.
func (*ScreenOrientation) Type ¶
func (_this *ScreenOrientation) Type() OrientationType
Type returning attribute 'type' with type OrientationType (idl: OrientationType).
func (*ScreenOrientation) Unlock ¶
func (_this *ScreenOrientation) Unlock()