"openils.vandelay.TreeDndSource", dijit._tree.dndSource, {
"_is_replaceable": function(spoint, dpoint, disroot) {
/* An OP can replace anything, but non-OPs can only replace other
- * non-OPs, EXCEPT when the dest is the root node (this allows
- * for simple "trees" with only a single non-OP node.
+ * non-OPs.
*/
- if (disroot)
- return true;
- else if (spoint.bool_op())
+ if (spoint.bool_op())
return true;
else if (!dpoint.bool_op())
return true;
var nodes = _factories_by_type[type]();
for (var i = 0; i < nodes.length; i++) dojo.place(nodes[i], table);
- this._add_consistent_controls(table);
+ if (type != "bool_op")
+ this._add_consistent_controls(table);
dojo.create(
"input", {
}
function render_vmsp_label(point, minimal) {
- /* "minimal" mode has two implications:
- * 1) for svf, only show the code, not the longer label.
- * 2) for bool ops, completely ingore negation
+ /* "minimal" has this implication:
+ * for svf, only show the code, not the longer label.
*/
if (point.bool_op()) {
- return (!minimal && openils.Util.isTrue(point.negate()) ? "N" : "") +
- point.bool_op();
+ return point.bool_op();
} else if (point.svf()) {
return (openils.Util.isTrue(point.negate()) ? "NOT " : "") + (
minimal ? point.svf() :
function render_expression_preview(r) {
if (r.children().length) {
- return (openils.Util.isTrue(r.negate()) ? "NOT " : "") +
- "(" + r.children().map(render_expression_preview).join(
- " " + render_vmsp_label(r, true /* minimal */) + " "
+ return "(" + r.children().map(render_expression_preview).join(
+ " " + render_vmsp_label(r) + " "
) + ")";
} else if (!r.bool_op()) {
return render_vmsp_label(r, true /* minimal */);