Browse Source

Merge pull request #146 in FUI/fineui from ~GUY/fineui:master to master

* commit '4ae207e7361d3a4383f65511361809faabbaa6f7':
  update
  update
master
guy 7 years ago
parent
commit
6f671e9d84
  1. 2
      bi/core.js
  2. 25
      demo/js/category/sortTree/demo.sortTree.js
  3. 2
      dist/bundle.js
  4. 4
      dist/bundle.min.js
  5. 2
      dist/core.js
  6. 25
      dist/demo.js
  7. 2
      src/core/wrapper/layout.js

2
bi/core.js

@ -11646,7 +11646,7 @@ BI.Layout = BI.inherit(BI.Widget, {
next = children[beforeKey].element; next = children[beforeKey].element;
} }
if (next.length > 0) { if (next.length > 0) {
next.before(children[insert].element); next.before(children[insertKey].element);
} else { } else {
self._getWrapper().append(children[insertKey].element); self._getWrapper().append(children[insertKey].element);
} }

25
demo/js/category/sortTree/demo.sortTree.js

@ -1,3 +1,23 @@
Demo.Expander = BI.inherit(BI.Widget, {
render: function () {
var self = this, o = this.options;
return {
type: "bi.expander",
ref: function () {
self.expander = this;
},
el: o.el,
popup: o.popup
}
},
update: function (opt) {
this.expander.populate(opt.items);
return true;
}
});
BI.shortcut("demo.sort_tree_expander", Demo.Expander)
/** /**
* guy * guy
* 二级树 * 二级树
@ -13,7 +33,9 @@ Demo.SortTree = BI.inherit(BI.Widget, {
this.tree = BI.createWidget({ this.tree = BI.createWidget({
type: "bi.custom_tree", type: "bi.custom_tree",
element: this, element: this,
expander: {}, expander: {
type: "demo.sort_tree_expander"
},
items: this._formatItems(0, tree.toJSON()), items: this._formatItems(0, tree.toJSON()),
@ -71,6 +93,7 @@ Demo.SortTree = BI.inherit(BI.Widget, {
} }
findTheNode.getParent().removeChild(node.id); findTheNode.getParent().removeChild(node.id);
parentNode.addChild(findTheNode, currentIndex); parentNode.addChild(findTheNode, currentIndex);
console.log(tree.toJSON());
self.tree.populate(self._formatItems(0, tree.toJSON())); self.tree.populate(self._formatItems(0, tree.toJSON()));
}, },
start: function (event, ui) { start: function (event, ui) {

2
dist/bundle.js vendored

@ -20002,7 +20002,7 @@ BI.Layout = BI.inherit(BI.Widget, {
next = children[beforeKey].element; next = children[beforeKey].element;
} }
if (next.length > 0) { if (next.length > 0) {
next.before(children[insert].element); next.before(children[insertKey].element);
} else { } else {
self._getWrapper().append(children[insertKey].element); self._getWrapper().append(children[insertKey].element);
} }

4
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/core.js vendored

@ -19951,7 +19951,7 @@ BI.Layout = BI.inherit(BI.Widget, {
next = children[beforeKey].element; next = children[beforeKey].element;
} }
if (next.length > 0) { if (next.length > 0) {
next.before(children[insert].element); next.before(children[insertKey].element);
} else { } else {
self._getWrapper().append(children[insertKey].element); self._getWrapper().append(children[insertKey].element);
} }

25
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
src/core/wrapper/layout.js

@ -462,7 +462,7 @@ BI.Layout = BI.inherit(BI.Widget, {
next = children[beforeKey].element; next = children[beforeKey].element;
} }
if (next.length > 0) { if (next.length > 0) {
next.before(children[insert].element); next.before(children[insertKey].element);
} else { } else {
self._getWrapper().append(children[insertKey].element); self._getWrapper().append(children[insertKey].element);
} }

Loading…
Cancel
Save