material 0.9.3 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "material",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "A lightweight implementation of Material Design Components for the web - ES6",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/src/list/add.js CHANGED
@@ -3,6 +3,10 @@ export default {
3
3
  add (info, context) {
4
4
  // console.log('list add', info)
5
5
 
6
+ if (this.options.reverse) {
7
+ context = 'bottom'
8
+ }
9
+
6
10
  if (!this.dataStore) return
7
11
  context = context !== undefined ? context : null
8
12
 
@@ -56,6 +56,10 @@ export default {
56
56
 
57
57
  data = data || []
58
58
 
59
+ if (this.options.reverse) {
60
+ data.reverse()
61
+ }
62
+
59
63
  if (data.error) {
60
64
  console.log('error', data.error)
61
65
  return
@@ -7,6 +7,20 @@ export default {
7
7
  this.getUpdatedInfo(info[this.dataId])
8
8
  },
9
9
 
10
+ updateInfo (info) {
11
+ // console.log('update', info)
12
+ this.dataStore[info._id] = info
13
+
14
+ // update item in the list if visible
15
+ const item = this.ui.body.querySelector('[data-id="' + info[this.dataId] + '"]')
16
+ if (item) {
17
+ item.innerHTML = ''
18
+ const layout = create(this.options.layout.item, item)
19
+
20
+ this.renderInfo(layout, info)
21
+ }
22
+ },
23
+
10
24
  getUpdatedIndex (id) {
11
25
  // console.log('getUpdatedIndex', id)
12
26
  let index = null