1.0.19 • Published 7 years ago
@artisfy/inputjs v1.0.19
DESCRIPTION
This library handles input of data and syncs it with other element's data attributes.
EXAMPLE ORDER OF EVENTS
- use switch.js to open an inline edit popover
- data is synced from the source element to the popover (inputElementEventListener.js)
- input is written and synced with a parent (inputElementEventListener.js)
- choices are made and synced with a parent (choiceEventListener.js)
- form is submitted and data is synced back to the source element (saveEventListener.js)
FILES AND THEIR RESPONSIBILITIES
- choiceEventListener.js
- listens for
clickevent on[data-i-key][data-i-value]elements and sets the value to a data attribute on a parent element
- listens for
- createFlatObject.js
- flattens a nested object/array into an object. duplicate keys are overwritten.
- fileUploadEventListener.js
- handles ajax file upload of images to a popover inline edit area
- inboundDataSyncEventListener.js
- this is weirdly named. when an inline edit popover is activated, this syncs the data from the source element to the popover's data
- index.js
- initializes all the code. runs all the watch functions on page load.
- inputElementEventListener.js
- syncs data from a text input to its parent component's data attribute
- optionsData.js
- an empty object that can be loaded from any component here. it's loaded into init functions inside
index.js
- an empty object that can be loaded from any component here. it's loaded into init functions inside
- onSave.js
- stores functions passed into
onSave()in an array. calls these functions whenever data is synced AND has been flagged as a save-worthy event. also contains a helper functioncallSaveFunctionfor manually triggering the save of an element.
- stores functions passed into
- removeEventListener.js
- listens for click on a
[data-i-remove]element (which will be inside an inline edit popover) and removes the associated source element (i.e. the element that triggered and syncs with the popover)
- listens for click on a
- saveEventListener.js
- listens for a
submitevent on a[data-i-sync]form (which will be inside an inline edit popover) and syncs the data from this form to the source element (i.e. the element that triggered and syncs with the popover)
- listens for a
- syncData.js
- the most important functions in this library.
syncDataToElementtakes an object of flat data and syncs it to the data attributes of a passed in element. syncDataBetweenElements extracts the data from one element and syncs it to another element.
- the most important functions in this library.
- watchHelpers.js
callMultipleWatchFunctionsallows passing in elements withdata-wattributes that can have special functions on them that need to be called every time their data is updated. these functions are also called insidesyncDataToElement, which means the watch functions are all triggered whenever data is synced into their corresponding data attribute
1.0.19
7 years ago
1.0.18
7 years ago
1.0.17
7 years ago
1.0.16
7 years ago
1.0.15
7 years ago
1.0.14
7 years ago
1.0.13
7 years ago
1.0.12
7 years ago
1.0.11
7 years ago
1.0.10
7 years ago
1.0.9
7 years ago
1.0.8
7 years ago
1.0.7
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago