diff --git a/resources/js/panel/general-events.js b/resources/js/panel/general-events.js
index ef0b1e8..426c969 100644
--- a/resources/js/panel/general-events.js
+++ b/resources/js/panel/general-events.js
@@ -1,26 +1,11 @@
-document.addEventListener('click', function(e) {
- if (e.target.classList.contains('delete-confirm')) {
- if (!confirm('Are you sure you want to delete this item?')) { // WIP Need to translate
- e.preventDefault();
- }
- }
-});
-
-document.querySelectorAll('.delete-confirm')?.forEach(function (el) {
- el.addEventListener('click',function (e) {
- if (!confirm('Are you sure you want to delete this item?')) { // WIP Need to translate
- e.preventDefault();
- }
- });
-});
-window.findUrl = function (name,item = null) {
+window.findUrl = function (name, item = null) {
for (var i = 0; i < window.routesList.length; i++) {
if (window.routesList[i].name === name) {
- if (item != null){
+ if (item != null) {
return window.routesList[i].url.split('{item}').join(item);
- }else{
+ } else {
return window.routesList[i].url;
}
}
@@ -30,3 +15,27 @@ window.findUrl = function (name,item = null) {
+document.addEventListener('DOMContentLoaded', () => {
+
+ document.addEventListener('click', function (e) {
+ if (e.target.classList.contains('delete-confirm')) {
+ if (!confirm('Are you sure you want to delete this item?')) { // WIP Need to translate
+ e.preventDefault();
+ }
+ }
+ });
+
+ document.querySelectorAll('.delete-confirm')?.forEach(function (el) {
+ el.addEventListener('click', function (e) {
+ if (!confirm('Are you sure you want to delete this item?')) { // WIP Need to translate
+ e.preventDefault();
+ }
+ });
+ });
+
+ document.querySelectorAll('[data-open-file]')?.forEach(function (el) {
+ el.addEventListener('click', function () {
+ document.querySelector(this.getAttribute('data-open-file')).click();
+ });
+ });
+});
diff --git a/resources/sass/panel/_common.scss b/resources/sass/panel/_common.scss
index e74eda6..9f7d200 100644
--- a/resources/sass/panel/_common.scss
+++ b/resources/sass/panel/_common.scss
@@ -194,3 +194,6 @@ a.btn,a.action-btn,a.circle-btn{
margin: 1rem auto;
}
}
+[data-open-file]{
+ cursor: pointer;
+}
diff --git a/resources/views/admin/categories/category-form.blade.php b/resources/views/admin/categories/category-form.blade.php
index 1c6fa58..1cf099c 100644
--- a/resources/views/admin/categories/category-form.blade.php
+++ b/resources/views/admin/categories/category-form.blade.php
@@ -30,7 +30,7 @@
{{__('Feature image')}}
-
+