[FIX] web: BS4, restore slider checkboxes

Take advantage of the new BS4 checkbox structure to simplify the
widget too.
This commit is contained in:
qsm-odoo
2018-08-23 16:45:40 +02:00
parent 6fd68c28cd
commit 9fc771dd5d
3 changed files with 34 additions and 58 deletions
@@ -2006,32 +2006,10 @@ var FieldBooleanButton = AbstractField.extend({
});
var BooleanToggle = FieldBoolean.extend({
className: FieldBoolean.prototype.className + ' o_boolean_toggle',
events: {
'click': '_onClick'
},
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
/**
* @override
* @private
*/
_render: function () {
this._super.apply(this, arguments);
this._renderToggleSwitch();
},
/**
* Display toggle switch
*
* @private
*/
_renderToggleSwitch: function () {
this.$el.addClass("o_boolean_toggle");
var $div = $('<div class="slider"></div>');
$div.insertAfter(this.$("input[type=checkbox]"));
},
//--------------------------------------------------------------------------
// Handlers
@@ -2048,7 +2026,6 @@ var BooleanToggle = FieldBoolean.extend({
this._setValue(!this.value);
this.$el.closest(".o_data_row").toggleClass('text-muted', this.value);
},
});
var StatInfo = AbstractField.extend({