Skip to content

Commit

Permalink
Refactor: remove Page._addSource because requestList do the same if r…
Browse files Browse the repository at this point in the history
…equest is editable
  • Loading branch information
nicolaslabbe committed Nov 4, 2016
1 parent 85242da commit 04e0b60
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/cli/cms/Page.js
Expand Up @@ -126,8 +126,6 @@ export default class Page {
}
}
}

this._addSource(json)

// We remove the {{abe type=data ...}} from the text
this.template = cmsData.source.removeDataList(this.template)
Expand Down Expand Up @@ -296,21 +294,4 @@ export default class Page {

return this
}

_addSource(json) {
var listReg = /({{abe.*type=[\'|\"]data.*}})/g
var match

while (match = listReg.exec(this.template)) {
var editable = cmsData.regex.getAttr(match[0], 'editable')
var key = cmsData.regex.getAttr(match[0], 'key')

if((typeof editable === 'undefined' || editable === null || editable === '' || editable === 'false')
&& typeof json[config.source.name] !== 'undefined' && json[config.source.name] !== null) {
json[key] = json[config.source.name][key]
}

json = abeExtend.hooks.instance.trigger('afterAddSourcePage', json, match[0])
}
}
}

0 comments on commit 04e0b60

Please sign in to comment.