Renan Pereira
Modal not working on Firefox
We "fixed" by applying the code below
{{-- Corrigir o problema no Firefox --}}
{{-- Too many calls to location or history APIs in a short period of time. --}}
<script>
const original = window.history.replaceState;
let timer = Date.now();
let timeout = null;
let lastArgs = null;
window.history.replaceState = function (...args) {
const time = Date.now();
if (time - timer < 300) {
lastArgs = args;
if (timeout) {
clearTimeout(timeout);
}
timeout = setTimeout(() => {
original.apply(this, lastArgs);
timeout = null;
lastArgs = null;
}, 100);
return;
}
timer = time;
original.apply(this, args);
};
</script>
16 replies
EditAction enabling hidden CreateAction in headerActions
CreateAction::make()
->icon('heroicon-c-plus')
->label('Adicionar')
->color('success')
->hidden(function () {
if (!Auth::user()->can('edit_empresas')) {
return true;
}
if (request()->routeIs('funcionarios.index')) {
return true;
}
})
20 replies