-
Notifications
You must be signed in to change notification settings - Fork 68
LCARS.setting
These are general settings that handle adding/removing specific classes or other attributes for an element. They are not attached to an elements prototype and such require the object to be passed. Any global setting can be overridden on a per element/widget basis within that elements/widgets prototype.
All elements should come with the premade setter and getter:
LCARS.active.elementID.set('settingName', value);
LCARS.active.elementID.get('settingName');
Sets: DOM Attribute | data-altLabel="value"
Pass: String
Sets: DOM Attributes
Pass-Set: object | {'attrName':'attrValue', 'attrName2':'attrValue2'}
Pass-Remove: object | {'attrName':null}
Sets: DOM Class
Pass-Set: object | {'className':true, 'className2':true}
Pass-Remove: object | {'className2':false}
This setting does not set anything but instead creates the child elements of this element. The setting is recursive so it will continue to loop until there are no more children to create. Additionally, if a DOM string is passed it will simply be appended to the parent element.
Pass: Array of Objects | [{type:'button'}, {type:'button'}, {type:'row', children:[{...}]}]
Pass: String | <div><h2>Some Text</h2></div>
For the text || title
elements there is a built in replace to swap the standard 'bg-' prefix for 'text-'.
Sets: DOM Class
Pass-Set: String | 'bg-blue-3' || 'text-red-2'
Pass-Remove: null
This setting is generally used to quickly assign color values to child elements within a parent. Each direct child of the parent, in order, matching indexes to the passed array of color strings.
Loops through and calls the color
setting
Sets: DOM Classes
Pass-Set: Array | ['bg-blue-3', 'bg-green-1', 'bg-blue-5']
Pass-Remove: ['bg-blue-3', null, 'bg-blue-5']
Sets: DOM Class
Pass-Set: String
Pass-Remove: null
Sets: CSS Class - .disabled
Pass: Boolean
Sets: CSS Class - .fade
Pass: Boolean
Sets: CSS Class | .flex-v || .flex-h
Pass-Set: String | v || h
Pass-Remove: null
Sets: CSS Class | .flex-c-v|| .flex-c-h
Pass-Set: String | v || h
Pass-Remove: null
Sets: CSS Class | .hidden
Pass: Boolean
Sets: DOM Attribute
Pass-Set: String
Pass-Remove: null
Empties the element and appends the passed html string. HTML created this way is not tracked or maintained within the LCARS framework. Best used for dynamic content areas continually updated with raw html.
Sets: Creates DOM Objects
Pass-Set: String
Pass-Remove: null
Sets: DOM Attribute
Pass-Set: String
Pass-Remove: null
Sets: DOM Attribute | data-altLabel="value"
Pass-Set: String
Pass-Remove: null
Sets: DOM Attribute
Pass-Set: String
Pass-Remove: null
Sets: DOM Attribute | data-group="value"
Pass-Set: String
Pass-Remove: null
Sets: CSS Class | .no-event
Pass: Boolean
Sets: CSS Class | .no-transition
Pass: Boolean
Turns an Text Input into a Password Input
Sets: DOM Attribute
Pass: Boolean
Makes an input Read Only
Sets: DOM Attribute
Pass: Boolean
Sets: CSS Class | .reverse
Pass: Boolean
Sets: DOM Class
Pass-Set: String
Pass-Remove: null
Sets: DOM Attribute
Pass-Set: String
Pass-Remove: null
Sets: DOM Class
Pass-Set: String
Pass-Remove: null
Sets: Inline CSS
Pass-Set: object | {'style-name':'value', 'max-height':'190px'}
Pass-Remove: object | {'style-name':false}
Sets: DOM Content
Pass-Set: String
Pass-Remove: null
Allows an element to have a toggle state. Visual representation is project independent. Toggle state will only toggle if a mouse/touch event is attached to the element. For 'eyecandy' switches simply attach an empty function to the click event.
Sets: CSS Class | .toggle
Pass: Boolean
Events That Accept Toggle Action:
- click
- mouseup
- tapend
- tap
- singletap
- doubletap
- taphold
- swipe
- swipeup
- swiperight
- swipedown
- swipeleft
- swipeend
- tap2
- taphold2
Sets: DOM Attribute | data-toggleGroup="value"
Pass-Set: String
Pass-Remove: null
Sets: DOM Class
Pass-Set: String
Pass-Remove: null
Attach a function to trigger when an element enters the DOM and another function to trigger when an element leaves the dom.
Functions gets bound to the prototype instance.
Do not use Leave as a substitute for Delete. There is no guarentee the prototype will still exist while the Leave function triggers. Use Leave as an internal function while an element/widget is functioning.
Pass-Set: Function
Pass-Remove: null
https://github.com/uzairfarooq/arrive
General function group.
Functions gets bound to the prototype instance.
Pass-Set: Object | {functionName:function(){}, functionName:function(){}}
Function group to receive data.
Functions gets bound to the prototype instance.
Pass-Set: Object | {functionName:function(){}, functionName:function(){}}
Functions that are looped through when the LCARS.delete
is called.
Functions get bound to the prototype instance.
Pass-Set: Object | {functionName:function(){}, functionName:function(){}}
Mouse/Tap/Screen events are where the majority of jQuery is utilized in the LCARS SDK. Only use Mouse events when there is no concern for device/input variation.
For touch events: https://github.com/benmajor/jQuery-Touch-Events
Functions 'this' are bound to the prototype instance.
Pass-Set: Function
-
click
-
mouseenter
-
mouseleave
-
mousedown
-
mouseup
-
mousemove
-
mouseout
-
mouseover
-
hover
-
tapstart
-
tapend
-
tap
-
singletap
-
doubletap
-
taphold
-
swipe
-
swipeup
-
swiperight
-
swipedown
-
swipeleft
-
swipeend
-
tap2
-
taphold2
-
scrollstart
-
scrollend
-
orientationchange