-
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] stock_barcodes_picking_batch_revision: Make toggle button bigger
- Loading branch information
1 parent
2ad017b
commit 1be1db0
Showing
7 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
* Sergio Teruel | ||
* Carlos Dauden | ||
* Carlos Roca |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
stock_barcodes_picking_batch_revision/static/src/js/boolean_toggle_big.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* Copyright 2024 Tecnativa - Carlos Roca | ||
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */ | ||
odoo.define( | ||
"stock_barcodes_picking_batch_revision.boolean_toggle_big", | ||
function (require) { | ||
"use strict"; | ||
|
||
var basic_fields = require("web.basic_fields"); | ||
var field_registry = require("web.field_registry"); | ||
|
||
var FieldBarcodeBooleanToggleBig = basic_fields.BooleanToggle.extend({ | ||
/** | ||
* Add class o_boolean_toggle_big to be able to modify css | ||
* | ||
* @override | ||
* @private | ||
*/ | ||
_render: function () { | ||
this._super.apply(this, arguments); | ||
this.$el.addClass("o_boolean_toggle_big"); | ||
}, | ||
}); | ||
|
||
field_registry.add("boolean_toggle_big", FieldBarcodeBooleanToggleBig); | ||
} | ||
); |
47 changes: 47 additions & 0 deletions
47
stock_barcodes_picking_batch_revision/static/src/scss/boolean_toggle_big.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* Copyright 2024 Tecnativa - Carlos Roca | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */ | ||
div.o_boolean_toggle_big.custom-control.custom-checkbox { | ||
$line-height-computed: $line-height-base * $font-size-base; | ||
$slider-width: $line-height-computed * 2.5; | ||
$font-size: $font-size-base * 2; | ||
|
||
display: inline-block; | ||
padding-left: $slider-width + 0.25rem; | ||
|
||
> label.custom-control-label { | ||
> i { | ||
color: white; | ||
cursor: pointer; | ||
font-size: $font-size; | ||
position: absolute; | ||
top: 2px; | ||
&.fa-times-circle { | ||
right: 24px; | ||
} | ||
&.fa-check-circle { | ||
right: 7px; | ||
} | ||
} | ||
&::before, | ||
&::after { | ||
content: ""; | ||
top: 0; | ||
left: -($slider-width + 0.25rem); | ||
} | ||
&::before { | ||
width: $slider-width; | ||
height: 150%; | ||
background-color: #a0a0a0 !important; | ||
border-radius: 100px; | ||
outline: none !important; | ||
} | ||
} | ||
> input.custom-control-input:checked + label.custom-control-label { | ||
&::before { | ||
background-color: $o-brand-primary !important; | ||
} | ||
&::after { | ||
background-image: none; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters