Skip to content

Commit

Permalink
namespace events, add id
Browse files Browse the repository at this point in the history
  • Loading branch information
luttje committed Apr 14, 2024
1 parent 530d1d4 commit 3f72128
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 20 deletions.
15 changes: 11 additions & 4 deletions resources/views/components/forms/inputs/color-picker.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@
pickr.on('save', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('input', currentColor);
input.setAttribute('value', currentColor);
$root.setAttribute('title', currentColor);
element.setAttribute('title', currentColor);
$dispatch('buk:color-save', {
id: '{{ $id }}',
color: currentColor
});
});
pickr.on('change', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('change', currentColor);
$dispatch('buk:color-change', {
id: '{{ $id }}',
color: currentColor
});
});
"
{{ $attributes->merge(['title' => $value]) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@
pickr.on('save', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('input', currentColor);
input.setAttribute('value', currentColor);
$root.setAttribute('title', currentColor);
element.setAttribute('title', currentColor);
$dispatch('buk:color-save', {
id: 'mainColor',
color: currentColor
});
});
pickr.on('change', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('change', currentColor);
$dispatch('buk:color-change', {
id: 'mainColor',
color: currentColor
});
});
"
title="" class="mr-2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@
pickr.on('save', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('input', currentColor);
input.setAttribute('value', currentColor);
$root.setAttribute('title', currentColor);
element.setAttribute('title', currentColor);
$dispatch('buk:color-save', {
id: 'color',
color: currentColor
});
});
pickr.on('change', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('change', currentColor);
$dispatch('buk:color-change', {
id: 'color',
color: currentColor
});
});
"
title="#FF9900"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@
pickr.on('save', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('input', currentColor);
input.setAttribute('value', currentColor);
$root.setAttribute('title', currentColor);
element.setAttribute('title', currentColor);
$dispatch('buk:color-save', {
id: 'color',
color: currentColor
});
});
pickr.on('change', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('change', currentColor);
$dispatch('buk:color-change', {
id: 'color',
color: currentColor
});
});
"
title=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@
pickr.on('save', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('input', currentColor);
input.setAttribute('value', currentColor);
$root.setAttribute('title', currentColor);
element.setAttribute('title', currentColor);
$dispatch('buk:color-save', {
id: 'color',
color: currentColor
});
});
pickr.on('change', function (color) {
let currentColor = color ? color.toHEXA().toString() : '';
$dispatch('change', currentColor);
$dispatch('buk:color-change', {
id: 'color',
color: currentColor
});
});
"
title=""
Expand Down

0 comments on commit 3f72128

Please sign in to comment.