Browse Source

Merge pull request #763 from Tecnativa/10.0-web_widget_domain_v11-fix_operator_selector

[FIX] web_widget_domain_v11: Allow to change operator
pull/766/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
3bdd1baccf
  1. 4
      web_widget_domain_v11/static/src/copied-css/domain_selector.less
  2. 4
      web_widget_domain_v11/static/src/copied-js/domain_selector.js
  3. 15
      web_widget_domain_v11/static/src/copied-xml/templates.xml

4
web_widget_domain_v11/static/src/copied-css/domain_selector.less

@ -9,10 +9,6 @@
} }
&.o_domain_tree { &.o_domain_tree {
.o_domain_tree_operator_caret::after {
.o-caret-down();
}
> .o_domain_node_children_container { > .o_domain_node_children_container {
padding-left: @o-domain-selector-indent; padding-left: @o-domain-selector-indent;

4
web_widget_domain_v11/static/src/copied-js/domain_selector.js

@ -84,10 +84,10 @@ var DomainNode = Widget.extend({
var DomainTree = DomainNode.extend({ var DomainTree = DomainNode.extend({
template: "DomainTree", template: "DomainTree",
events: _.extend({}, DomainNode.prototype.events, { events: _.extend({}, DomainNode.prototype.events, {
"click .o_domain_tree_operator_selector > ul > li > a": function (e) {
"change .o_domain_tree_operator_selector": function (e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
this.changeOperator($(e.target).data("operator"));
this.changeOperator($(e.target).val());
}, },
}), }),
custom_events: { custom_events: {

15
web_widget_domain_v11/static/src/copied-xml/templates.xml

@ -26,16 +26,11 @@
</div> </div>
</t> </t>
<t t-name="DomainTree.OperatorSelector"> <t t-name="DomainTree.OperatorSelector">
<div t-if="!widget.readonly" class="btn-group o_domain_tree_operator_selector">
<button class="btn btn-xs btn-primary o_domain_tree_operator_caret" data-toggle="dropdown">
<t t-if="widget.operator === '&amp;'">All</t>
<t t-if="widget.operator === '|'">Any</t>
<t t-if="widget.operator === '!'">None</t>
</button>
<ul class="dropdown-menu">
<li><a href="#" data-operator="&amp;">All</a></li>
<li><a href="#" data-operator="|">Any</a></li>
</ul>
<div t-if="!widget.readonly" class="btn-group">
<select class="o_domain_tree_operator_selector">
<option value="&amp;" t-att-selected="widget.operator === '&amp;' ? 'selected' : null">All</option>
<option value="|" t-att-selected="widget.operator === '|' ? 'selected' : null">Any</option>
</select>
</div> </div>
<strong t-else=""> <strong t-else="">
<t t-if="widget.operator === '&amp;'">ALL</t> <t t-if="widget.operator === '&amp;'">ALL</t>

Loading…
Cancel
Save