Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef Gabrielsson committed Aug 11, 2024
1 parent 32ac790 commit 5514b2c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nightly/modules/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ app.module.data = {
var value = element.getAttribute('data-bind')
dom.bind(element, value, 'data-bind')
app.variables.update.attributes(element, 'l', 'eng', false)

var target = value.split(':')
if (target && target[1][0] === '#') {
console.log(dom.get(target[1])) // Get the element
}
},

src: function (element) {
Expand Down Expand Up @@ -121,11 +126,13 @@ app.module.data = {
datareplace = element.getAttribute('data-replace'),
dataiterate = element.getAttribute('data-iterate'),
datasort = element.getAttribute('data-sort'),
databind = element.getAttribute('data-bind'),
datastatus = element.getAttribute('data-status'),
dataempty = element.getAttribute('data-onempty'),
datasuccess = element.attributes['data-onsuccess'],
selector = '*:not([data-iterate-skip]'


if (responseData) {
if (datamerge) {
var responseDataJoin = app.caches.get(this.storageMechanism, this.storageType, options.storageKey.replace('join', '') + 'join')
Expand All @@ -150,6 +157,13 @@ app.module.data = {
this._replace(responseData.data, datareplace)
}

if (databind) {
var test = databind.split(':'),
realValue = app.element.getPropertyByPath(responseData.data, test[0]),
target = dom.get(test[1])
app.element.set(target, realValue)
}

if (datasort) {
var datasortorder = element.getAttribute('data-sortorder')
this._sort(responseData.data, datasort, datasortorder)
Expand Down

0 comments on commit 5514b2c

Please sign in to comment.