You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ha...@apache.org on 2017/12/28 03:26:33 UTC
[1/2] incubator-weex git commit: * [jsfm] support append tree on root
element
Repository: incubator-weex
Updated Branches:
refs/heads/master aefda3c74 -> 07f80f81a
* [jsfm] support append tree on root element
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9afc4d53
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9afc4d53
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9afc4d53
Branch: refs/heads/master
Commit: 9afc4d53424dde83bfc91d3ad5b514c25ec52e4f
Parents: a45d51b
Author: Hanks <zh...@gmail.com>
Authored: Fri Dec 22 14:57:48 2017 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Fri Dec 22 15:49:42 2017 +0800
----------------------------------------------------------------------
html5/runtime/vdom/operation.js | 10 ++--------
html5/test/unit/default/vm/vm.js | 20 ++++++++------------
2 files changed, 10 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9afc4d53/html5/runtime/vdom/operation.js
----------------------------------------------------------------------
diff --git a/html5/runtime/vdom/operation.js b/html5/runtime/vdom/operation.js
index 460732a..69a64e1 100644
--- a/html5/runtime/vdom/operation.js
+++ b/html5/runtime/vdom/operation.js
@@ -122,15 +122,9 @@ export function appendBody (doc, node, before) {
function sendBody (doc, node) {
const body = node.toJSON()
- const children = body.children
- delete body.children
- let result = doc.taskCenter.send('dom', { action: 'createBody' }, [body])
- if (children) {
- children.forEach(child => {
- result = doc.taskCenter.send('dom', { action: 'addElement' }, [body.ref, child, -1])
- })
+ if (doc && doc.taskCenter && typeof doc.taskCenter.send === 'function') {
+ doc.taskCenter.send('dom', { action: 'createBody' }, [body])
}
- return result
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9afc4d53/html5/test/unit/default/vm/vm.js
----------------------------------------------------------------------
diff --git a/html5/test/unit/default/vm/vm.js b/html5/test/unit/default/vm/vm.js
index bc3b0bc..1ce0db3 100644
--- a/html5/test/unit/default/vm/vm.js
+++ b/html5/test/unit/default/vm/vm.js
@@ -245,20 +245,16 @@ describe('generate virtual dom for a single vm', () => {
attr: {
append: 'tree'
},
+ children: [{
+ ref: spy.firstCall.args[2].children[0].ref,
+ type: 'text',
+ attr: {
+ value: '<some text content>'
+ },
+ style: {}
+ }],
style: {}
})
- expect(spy.secondCall.args[0]).to.be.equal('test')
- expect(spy.secondCall.args[1]).to.be.equal('addElement')
- expect(spy.secondCall.args[2]).to.be.equal('_root')
- expect(spy.secondCall.args[3]).to.deep.equal({
- ref: spy.secondCall.args[3].ref,
- type: 'text',
- attr: {
- value: '<some text content>'
- },
- style: {}
- })
- expect(spy.secondCall.args[4]).to.be.equal(-1)
expect(vm._app).equal(app)
const el = doc.body
[2/2] incubator-weex git commit: [WEEX-183] Support append tree on
root element (#954)
Posted by ha...@apache.org.
[WEEX-183] Support append tree on root element (#954)
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/07f80f81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/07f80f81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/07f80f81
Branch: refs/heads/master
Commit: 07f80f81a7e78856dc52bb6c5f582238b8140e1a
Parents: aefda3c 9afc4d5
Author: Hanks <zh...@gmail.com>
Authored: Thu Dec 28 11:25:50 2017 +0800
Committer: Hanks <zh...@gmail.com>
Committed: Thu Dec 28 11:25:50 2017 +0800
----------------------------------------------------------------------
html5/runtime/vdom/operation.js | 10 ++--------
html5/test/unit/default/vm/vm.js | 20 ++++++++------------
2 files changed, 10 insertions(+), 20 deletions(-)
----------------------------------------------------------------------