Merge branch 'master' of github.com:akaunting/akaunting
This commit is contained in:
commit
0f1a4c9759
@ -4,6 +4,7 @@ namespace App\Models\Common;
|
|||||||
|
|
||||||
use App\Abstracts\Model;
|
use App\Abstracts\Model;
|
||||||
use App\Models\Document\Document;
|
use App\Models\Document\Document;
|
||||||
|
use App\Utilities\Str;
|
||||||
use App\Traits\Currencies;
|
use App\Traits\Currencies;
|
||||||
use App\Traits\Media;
|
use App\Traits\Media;
|
||||||
use Bkwld\Cloner\Cloneable;
|
use Bkwld\Cloner\Cloneable;
|
||||||
@ -138,6 +139,11 @@ class Item extends Model
|
|||||||
->select('items.*');
|
->select('items.*');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getInitialsAttribute($value)
|
||||||
|
{
|
||||||
|
return Str::getInitials($this->name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current balance.
|
* Get the current balance.
|
||||||
*
|
*
|
||||||
|
@ -31,9 +31,9 @@
|
|||||||
<input
|
<input
|
||||||
v-if="!show_date"
|
v-if="!show_date"
|
||||||
type="text"
|
type="text"
|
||||||
class="w-full bg-transparent text-black text-sm border-0 px-10 pb-0 focus:outline-none focus:ring-transparent focus:border-purple-100"
|
class="w-full bg-transparent text-black text-sm border-0 pb-0 focus:outline-none focus:ring-transparent focus:border-purple-100"
|
||||||
:class="[{'px-4' : !show_icon}]"
|
:class="!show_icon ? 'px-4' : 'px-10'"
|
||||||
:placeholder="placeholder"
|
:placeholder="dynamicPlaceholder"
|
||||||
:ref="'input-search-field-' + _uid"
|
:ref="'input-search-field-' + _uid"
|
||||||
v-model="search"
|
v-model="search"
|
||||||
@focus="onInputFocus"
|
@focus="onInputFocus"
|
||||||
@ -47,8 +47,9 @@
|
|||||||
@on-open="onInputFocus"
|
@on-open="onInputFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
:config="dateConfig"
|
:config="dateConfig"
|
||||||
class="w-full bg-transparent text-black text-sm border-0 px-10 pb-0 focus:outline-none focus:ring-transparent focus:border-purple-100 datepicker"
|
class="w-full bg-transparent text-black text-sm border-0 pb-0 focus:outline-none focus:ring-transparent focus:border-purple-100 datepicker"
|
||||||
:placeholder="placeholder"
|
:class="!show_icon ? 'px-4' : 'px-10'"
|
||||||
|
:placeholder="dynamicPlaceholder"
|
||||||
:ref="'input-search-date-field-' + _uid"
|
:ref="'input-search-date-field-' + _uid"
|
||||||
value=""
|
value=""
|
||||||
@focus="onInputFocus"
|
@focus="onInputFocus"
|
||||||
@ -56,7 +57,13 @@
|
|||||||
@keyup.enter="onInputConfirm"
|
@keyup.enter="onInputConfirm"
|
||||||
>
|
>
|
||||||
</flat-picker>
|
</flat-picker>
|
||||||
<span class="material-icons absolute bottom-1 ltr:left-3 rtl:right-3 text-lg text-black" style="z-index:-1;">search</span>
|
<span
|
||||||
|
v-if="show_icon"
|
||||||
|
class="material-icons absolute bottom-1 ltr:left-3 rtl:right-3 text-lg text-black"
|
||||||
|
style="z-index:-1;"
|
||||||
|
>
|
||||||
|
search
|
||||||
|
</span>
|
||||||
|
|
||||||
<button type="button" class="absolute ltr:right-0 rtl:left-0 top-2 clear" v-if="show_close_icon" @click="onSearchAndFilterClear">
|
<button type="button" class="absolute ltr:right-0 rtl:left-0 top-2 clear" v-if="show_close_icon" @click="onSearchAndFilterClear">
|
||||||
<span class="material-icons text-sm">close</span>
|
<span class="material-icons text-sm">close</span>
|
||||||
@ -126,6 +133,12 @@ export default {
|
|||||||
default: 'Search or filter results...',
|
default: 'Search or filter results...',
|
||||||
description: 'Input placeholder'
|
description: 'Input placeholder'
|
||||||
},
|
},
|
||||||
|
selectPlaceholder: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
enterPlaceholder: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
searchText: {
|
searchText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'Search for this text',
|
default: 'Search for this text',
|
||||||
@ -200,7 +213,9 @@ export default {
|
|||||||
show_close_icon: false,
|
show_close_icon: false,
|
||||||
show_icon: true,
|
show_icon: true,
|
||||||
equal_image: app_url + "/public/img/tailwind_icons/not-equal.svg",
|
equal_image: app_url + "/public/img/tailwind_icons/not-equal.svg",
|
||||||
input_focus: false
|
input_focus: false,
|
||||||
|
defaultPlaceholder: this.placeholder,
|
||||||
|
dynamicPlaceholder: this.placeholder,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -370,10 +385,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onOptionSelected(value) {
|
onOptionSelected(value) {
|
||||||
this.show_icon = false;
|
|
||||||
this.current_value = value;
|
this.current_value = value;
|
||||||
this.range = false;
|
this.range = false;
|
||||||
|
|
||||||
|
this.onChangeSearchAndFilterText(this.selectPlaceholder, false);
|
||||||
|
|
||||||
let option = false;
|
let option = false;
|
||||||
let option_url = false;
|
let option_url = false;
|
||||||
|
|
||||||
@ -505,6 +521,8 @@ export default {
|
|||||||
this.show_close_icon = true;
|
this.show_close_icon = true;
|
||||||
let select_value = false;
|
let select_value = false;
|
||||||
|
|
||||||
|
this.onChangeSearchAndFilterText(this.enterPlaceholder, false);
|
||||||
|
|
||||||
for (let i = 0; i < this.values.length; i++) {
|
for (let i = 0; i < this.values.length; i++) {
|
||||||
if (this.values[i].key == value) {
|
if (this.values[i].key == value) {
|
||||||
select_value = this.values[i].value;
|
select_value = this.values[i].value;
|
||||||
@ -561,6 +579,10 @@ export default {
|
|||||||
this.selected_values.splice(index, 1);
|
this.selected_values.splice(index, 1);
|
||||||
|
|
||||||
this.show_date = false;
|
this.show_date = false;
|
||||||
|
|
||||||
|
if (this.filter_index == 0) {
|
||||||
|
this.onChangeSearchAndFilterText(this.defaultPlaceholder, true);
|
||||||
|
}
|
||||||
|
|
||||||
this.filter_last_step = 'options';
|
this.filter_last_step = 'options';
|
||||||
},
|
},
|
||||||
@ -574,6 +596,11 @@ export default {
|
|||||||
this.onInputConfirm();
|
this.onInputConfirm();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onChangeSearchAndFilterText(arg, param) {
|
||||||
|
this.dynamicPlaceholder = arg;
|
||||||
|
this.show_icon = param;
|
||||||
|
},
|
||||||
|
|
||||||
convertOption(options) {
|
convertOption(options) {
|
||||||
let values = [];
|
let values = [];
|
||||||
|
|
||||||
@ -742,6 +769,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
if (this.filter_index > 0) {
|
||||||
|
this.onChangeSearchAndFilterText(this.enterPlaceholder, false);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -270,6 +270,8 @@ return [
|
|||||||
'placeholder' => [
|
'placeholder' => [
|
||||||
'search' => 'Type to search..',
|
'search' => 'Type to search..',
|
||||||
'search_and_filter' => 'Search or filter results..',
|
'search_and_filter' => 'Search or filter results..',
|
||||||
|
'select_and_filter' => 'Select one of the available options below',
|
||||||
|
'enter_and_filter' => 'Hit enter to filter the results, or set a new filter',
|
||||||
'contact_search' => 'Type a :type name',
|
'contact_search' => 'Type a :type name',
|
||||||
'item_search' => 'Type an item name',
|
'item_search' => 'Type an item name',
|
||||||
],
|
],
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
|
|
||||||
@stack('remove_th_start')
|
@stack('remove_th_start')
|
||||||
|
|
||||||
<th class="border-t-0 border-r-0 border-b-0" style="vertical-align:bottom;">
|
<th class="border-t-0 border-r-0 border-b-0 align-bottom" style="width:24px; display:block;">
|
||||||
<div></div>
|
<div></div>
|
||||||
</th>
|
</th>
|
||||||
|
|
||||||
|
@ -31,12 +31,14 @@
|
|||||||
const menuBackground = document.querySelector(".js-menu-background");
|
const menuBackground = document.querySelector(".js-menu-background");
|
||||||
const menuClose = document.querySelector("[data-menu-close]");
|
const menuClose = document.querySelector("[data-menu-close]");
|
||||||
|
|
||||||
|
//animation for notification icon
|
||||||
if (document.querySelector('[data-menu="notifications-menu"]')) {
|
if (document.querySelector('[data-menu="notifications-menu"]')) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
document.querySelector('[data-menu="notifications-menu"]').classList.remove("animate-vibrate");
|
document.querySelector('[data-menu="notifications-menu"]').classList.remove("animate-vibrate");
|
||||||
}, 6000);
|
}, 6000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//chevron active class action
|
||||||
Array.from(detailsEL).forEach((el) => {
|
Array.from(detailsEL).forEach((el) => {
|
||||||
el.addEventListener("toggle", function(e) {
|
el.addEventListener("toggle", function(e) {
|
||||||
if (e.target.querySelector(".material-icons-outlined")) {
|
if (e.target.querySelector(".material-icons-outlined")) {
|
||||||
@ -52,18 +54,21 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//container animation when left menu shrinking
|
||||||
function contentTransitionLeft() {
|
function contentTransitionLeft() {
|
||||||
sectionContent.classList.add("xl:ltr:ml-0", "xl:rtl:mr-0");
|
sectionContent.classList.add("xl:ltr:ml-0", "xl:rtl:mr-0");
|
||||||
sectionContent.classList.remove("xl:ltr:ml-64", "xl:rtl:mr-64");
|
sectionContent.classList.remove("xl:ltr:ml-64", "xl:rtl:mr-64");
|
||||||
toggleButton.querySelector("span").classList.add("ltr:-rotate-90", "rtl:rotate-90");
|
toggleButton.querySelector("span").classList.add("ltr:-rotate-90", "rtl:rotate-90");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//container animation when left menu unshrinking
|
||||||
function contentTransitionRight() {
|
function contentTransitionRight() {
|
||||||
sectionContent.classList.remove("xl:ltr:ml-0", "xl:rtl:mr-0");
|
sectionContent.classList.remove("xl:ltr:ml-0", "xl:rtl:mr-0");
|
||||||
sectionContent.classList.add("xl:ltr:ml-64", "xl:rtl:mr-64");
|
sectionContent.classList.add("xl:ltr:ml-64", "xl:rtl:mr-64");
|
||||||
toggleButton.querySelector("span").classList.remove("ltr:-rotate-90", "rtl:rotate-90");
|
toggleButton.querySelector("span").classList.remove("ltr:-rotate-90", "rtl:rotate-90");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if there are notifications, remove count badge
|
||||||
function notificationCount(action) {
|
function notificationCount(action) {
|
||||||
let notification_count = document.querySelector('[data-notification-count]');
|
let notification_count = document.querySelector('[data-notification-count]');
|
||||||
|
|
||||||
@ -72,6 +77,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//slide menu actions together responsive version
|
||||||
function slideMenu() {
|
function slideMenu() {
|
||||||
if (document.body.clientWidth <= 1280) {
|
if (document.body.clientWidth <= 1280) {
|
||||||
mobileMenuHidden();
|
mobileMenuHidden();
|
||||||
@ -99,10 +105,12 @@
|
|||||||
slideMenu();
|
slideMenu();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//general left menu actions (show settings menu etc..)
|
||||||
function toggleMenu(iconButton, event) {
|
function toggleMenu(iconButton, event) {
|
||||||
const menuRef = iconButton.getAttribute("data-menu");
|
const menuRef = iconButton.getAttribute("data-menu");
|
||||||
const icon = iconButton.children[0].getAttribute("name");
|
const icon = iconButton.children[0].getAttribute("name");
|
||||||
|
|
||||||
|
//if event target, profile
|
||||||
if (iconButton.getAttribute("data-menu") === "profile-menu") {
|
if (iconButton.getAttribute("data-menu") === "profile-menu") {
|
||||||
if (iconButton.children[0].textContent != "cancel") {
|
if (iconButton.children[0].textContent != "cancel") {
|
||||||
iconButton.children[0].classList.remove("hidden");
|
iconButton.children[0].classList.remove("hidden");
|
||||||
@ -113,6 +121,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//remove active (cancel text) class form target icon
|
||||||
menuButtons.forEach((button) => {
|
menuButtons.forEach((button) => {
|
||||||
if (icon) {
|
if (icon) {
|
||||||
if (button.getAttribute("data-menu") !== menuRef && iconButton.children[0].textContent != "cancel") {
|
if (button.getAttribute("data-menu") !== menuRef && iconButton.children[0].textContent != "cancel") {
|
||||||
@ -123,6 +132,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
menus.forEach((menu) => {
|
menus.forEach((menu) => {
|
||||||
|
//add active (cancel text) class form target icon
|
||||||
if (menu.classList.contains(menuRef) && iconButton.children[0].textContent != "cancel") {
|
if (menu.classList.contains(menuRef) && iconButton.children[0].textContent != "cancel") {
|
||||||
iconButton.children[0].textContent = "cancel";
|
iconButton.children[0].textContent = "cancel";
|
||||||
iconButton.children[0].classList.add("active");
|
iconButton.children[0].classList.add("active");
|
||||||
@ -135,6 +145,7 @@
|
|||||||
|
|
||||||
notificationCount("none");
|
notificationCount("none");
|
||||||
|
|
||||||
|
//remove active (cancel text) class form target icon
|
||||||
} else if (menu.classList.contains(menuRef) && iconButton.children[0].textContent == "cancel") {
|
} else if (menu.classList.contains(menuRef) && iconButton.children[0].textContent == "cancel") {
|
||||||
iconButton.children[0].textContent = icon;
|
iconButton.children[0].textContent = icon;
|
||||||
iconButton.children[0].classList.remove("active");
|
iconButton.children[0].classList.remove("active");
|
||||||
@ -146,12 +157,13 @@
|
|||||||
menuClose.classList.add("hidden");
|
menuClose.classList.add("hidden");
|
||||||
|
|
||||||
notificationCount("flex");
|
notificationCount("flex");
|
||||||
|
//left menu slide to left
|
||||||
} else {
|
} else {
|
||||||
menu.classList.add("ltr:-left-80", "rtl:-right-80");
|
menu.classList.add("ltr:-left-80", "rtl:-right-80");
|
||||||
menu.classList.remove("ltr:left-14", "rtl:right-14");
|
menu.classList.remove("ltr:left-14", "rtl:right-14");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//close icon click event
|
||||||
menuClose.addEventListener("click", function() {
|
menuClose.addEventListener("click", function() {
|
||||||
menu.classList.add("ltr:-left-80", "rtl:-right-80");
|
menu.classList.add("ltr:-left-80", "rtl:-right-80");
|
||||||
menu.classList.remove("ltr:left-14", "rtl:right-14");
|
menu.classList.remove("ltr:left-14", "rtl:right-14");
|
||||||
@ -165,6 +177,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (document.body.clientWidth >= 1280) {
|
if (document.body.clientWidth >= 1280) {
|
||||||
|
//if url have profile menu, profile menu show
|
||||||
if (is_profile_menu == 1) {
|
if (is_profile_menu == 1) {
|
||||||
let profile_menu_html = document.querySelector(".profile-menu");
|
let profile_menu_html = document.querySelector(".profile-menu");
|
||||||
let profile_icon_html = document.querySelector("[data-menu='profile-menu']");
|
let profile_icon_html = document.querySelector("[data-menu='profile-menu']");
|
||||||
@ -180,6 +193,7 @@
|
|||||||
toggleButton.classList.add("invisible");
|
toggleButton.classList.add("invisible");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if url have settings menu, settings menu show
|
||||||
if (is_settings_menu == 1) {
|
if (is_settings_menu == 1) {
|
||||||
let settings_menu_html = document.querySelector(".settings-menu");
|
let settings_menu_html = document.querySelector(".settings-menu");
|
||||||
let settings_icon_html = document.querySelector("[data-menu='settings-menu']");
|
let settings_icon_html = document.querySelector("[data-menu='settings-menu']");
|
||||||
@ -193,6 +207,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if mobile menu, menu is active
|
||||||
function mobileMenuActive() {
|
function mobileMenuActive() {
|
||||||
navbarMenu.classList.add("ltr:left-0", "rtl:right-0");
|
navbarMenu.classList.add("ltr:left-0", "rtl:right-0");
|
||||||
navbarMenu.classList.remove("ltr:-left-80", "rtl:-right-80");
|
navbarMenu.classList.remove("ltr:-left-80", "rtl:-right-80");
|
||||||
@ -201,6 +216,7 @@
|
|||||||
menuBackground.classList.remove("invisible");
|
menuBackground.classList.remove("invisible");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if mobile menu, menu is hidden
|
||||||
function mobileMenuHidden() {
|
function mobileMenuHidden() {
|
||||||
navbarMenu.classList.remove("ltr:left-0", "rtl:right-0");
|
navbarMenu.classList.remove("ltr:left-0", "rtl:right-0");
|
||||||
navbarMenu.classList.add("ltr:-left-80", "rtl:-right:80");
|
navbarMenu.classList.add("ltr:-left-80", "rtl:-right:80");
|
||||||
|
@ -31,12 +31,14 @@
|
|||||||
const menuBackground = document.querySelector(".js-menu-background");
|
const menuBackground = document.querySelector(".js-menu-background");
|
||||||
const menuClose = document.querySelector("[data-menu-close]");
|
const menuClose = document.querySelector("[data-menu-close]");
|
||||||
|
|
||||||
|
//animation for notification icon
|
||||||
if (document.querySelector('[data-menu="notifications-menu"]')) {
|
if (document.querySelector('[data-menu="notifications-menu"]')) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
document.querySelector('[data-menu="notifications-menu"]').classList.remove("animate-vibrate");
|
document.querySelector('[data-menu="notifications-menu"]').classList.remove("animate-vibrate");
|
||||||
}, 6000);
|
}, 6000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//chevron active class action
|
||||||
Array.from(detailsEL).forEach((el) => {
|
Array.from(detailsEL).forEach((el) => {
|
||||||
el.addEventListener("toggle", function(e) {
|
el.addEventListener("toggle", function(e) {
|
||||||
if(e.target.querySelector(".material-icons-outlined")) {
|
if(e.target.querySelector(".material-icons-outlined")) {
|
||||||
@ -48,18 +50,21 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//container animation when left menu shrinking
|
||||||
function contentTransitionLeft() {
|
function contentTransitionLeft() {
|
||||||
sectionContent.classList.add("xl:ltr:ml-0", "xl:rtl:mr-0");
|
sectionContent.classList.add("xl:ltr:ml-0", "xl:rtl:mr-0");
|
||||||
sectionContent.classList.remove("xl:ltr:ml-64", "xl:rtl:mr-64");
|
sectionContent.classList.remove("xl:ltr:ml-64", "xl:rtl:mr-64");
|
||||||
toggleButton.querySelector("span").classList.add("ltr:-rotate-90", "rtl:rotate-90");
|
toggleButton.querySelector("span").classList.add("ltr:-rotate-90", "rtl:rotate-90");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//container animation when left menu unshrinking
|
||||||
function contentTransitionRight() {
|
function contentTransitionRight() {
|
||||||
sectionContent.classList.remove("xl:ltr:ml-0", "xl:rtl:mr-0");
|
sectionContent.classList.remove("xl:ltr:ml-0", "xl:rtl:mr-0");
|
||||||
sectionContent.classList.add("xl:ltr:ml-64", "xl:rtl:mr-64");
|
sectionContent.classList.add("xl:ltr:ml-64", "xl:rtl:mr-64");
|
||||||
toggleButton.querySelector("span").classList.remove("ltr:-rotate-90", "rtl:rotate-90");
|
toggleButton.querySelector("span").classList.remove("ltr:-rotate-90", "rtl:rotate-90");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//slide menu actions together responsive version
|
||||||
function slideMenu() {
|
function slideMenu() {
|
||||||
if (document.body.clientWidth <= 1280) {
|
if (document.body.clientWidth <= 1280) {
|
||||||
mobileMenuHidden();
|
mobileMenuHidden();
|
||||||
@ -87,10 +92,12 @@
|
|||||||
slideMenu();
|
slideMenu();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//general left menu actions (show settings menu etc..)
|
||||||
function toggleMenu(iconButton, event) {
|
function toggleMenu(iconButton, event) {
|
||||||
const menuRef = iconButton.getAttribute("data-menu");
|
const menuRef = iconButton.getAttribute("data-menu");
|
||||||
const icon = iconButton.children[0].getAttribute("name");
|
const icon = iconButton.children[0].getAttribute("name");
|
||||||
|
|
||||||
|
//if event target, profile
|
||||||
if (iconButton.getAttribute("data-menu") === "profile-menu") {
|
if (iconButton.getAttribute("data-menu") === "profile-menu") {
|
||||||
if (iconButton.children[0].textContent != "cancel") {
|
if (iconButton.children[0].textContent != "cancel") {
|
||||||
iconButton.children[0].classList.remove("hidden");
|
iconButton.children[0].classList.remove("hidden");
|
||||||
@ -101,6 +108,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//remove active (cancel text) class form target icon
|
||||||
menuButtons.forEach((button) => {
|
menuButtons.forEach((button) => {
|
||||||
if (icon) {
|
if (icon) {
|
||||||
if (button.getAttribute("data-menu") !== menuRef && iconButton.children[0].textContent != "cancel") {
|
if (button.getAttribute("data-menu") !== menuRef && iconButton.children[0].textContent != "cancel") {
|
||||||
@ -111,6 +119,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
menus.forEach((menu) => {
|
menus.forEach((menu) => {
|
||||||
|
//add active (cancel text) class form target icon
|
||||||
if (menu.classList.contains(menuRef) && iconButton.children[0].textContent != "cancel") {
|
if (menu.classList.contains(menuRef) && iconButton.children[0].textContent != "cancel") {
|
||||||
iconButton.children[0].textContent = "cancel";
|
iconButton.children[0].textContent = "cancel";
|
||||||
iconButton.children[0].classList.add("active");
|
iconButton.children[0].classList.add("active");
|
||||||
@ -121,6 +130,7 @@
|
|||||||
toggleButton.classList.add("invisible");
|
toggleButton.classList.add("invisible");
|
||||||
menuClose.classList.remove("hidden");
|
menuClose.classList.remove("hidden");
|
||||||
|
|
||||||
|
//remove active (cancel text) class form target icon
|
||||||
} else if (menu.classList.contains(menuRef) && iconButton.children[0].textContent == "cancel") {
|
} else if (menu.classList.contains(menuRef) && iconButton.children[0].textContent == "cancel") {
|
||||||
iconButton.children[0].textContent = icon;
|
iconButton.children[0].textContent = icon;
|
||||||
iconButton.children[0].classList.remove("active");
|
iconButton.children[0].classList.remove("active");
|
||||||
@ -130,11 +140,13 @@
|
|||||||
mainContent.classList.remove("hidden");
|
mainContent.classList.remove("hidden");
|
||||||
toggleButton.classList.remove("invisible");
|
toggleButton.classList.remove("invisible");
|
||||||
menuClose.classList.add("hidden");
|
menuClose.classList.add("hidden");
|
||||||
|
//left menu slide to left
|
||||||
} else {
|
} else {
|
||||||
menu.classList.add("ltr:-left-80", "rtl:-right-80");
|
menu.classList.add("ltr:-left-80", "rtl:-right-80");
|
||||||
menu.classList.remove("ltr:left-14", "rtl:right-14");
|
menu.classList.remove("ltr:left-14", "rtl:right-14");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//close icon click event
|
||||||
menuClose.addEventListener("click", function() {
|
menuClose.addEventListener("click", function() {
|
||||||
menu.classList.add("ltr:-left-80", "rtl:-right-80");
|
menu.classList.add("ltr:-left-80", "rtl:-right-80");
|
||||||
iconButton.children[0].textContent = icon;
|
iconButton.children[0].textContent = icon;
|
||||||
@ -147,6 +159,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (document.body.clientWidth >= 1280) {
|
if (document.body.clientWidth >= 1280) {
|
||||||
|
//if url have profile menu, profile menu show
|
||||||
if (is_profile_menu == 1) {
|
if (is_profile_menu == 1) {
|
||||||
let profile_menu_html = document.querySelector(".profile-menu");
|
let profile_menu_html = document.querySelector(".profile-menu");
|
||||||
let profile_icon_html = document.querySelector("[data-menu='profile-menu']");
|
let profile_icon_html = document.querySelector("[data-menu='profile-menu']");
|
||||||
@ -164,6 +177,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if mobile menu, menu is active
|
||||||
function mobileMenuActive() {
|
function mobileMenuActive() {
|
||||||
navbarMenu.classList.add("ltr:left-0", "rtl:right-0");
|
navbarMenu.classList.add("ltr:left-0", "rtl:right-0");
|
||||||
navbarMenu.classList.remove("ltr:-left-80", "rtl:-right-80");
|
navbarMenu.classList.remove("ltr:-left-80", "rtl:-right-80");
|
||||||
@ -172,6 +186,7 @@
|
|||||||
menuBackground.classList.remove("invisible");
|
menuBackground.classList.remove("invisible");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if mobile menu, menu is hidden
|
||||||
function mobileMenuHidden() {
|
function mobileMenuHidden() {
|
||||||
navbarMenu.classList.remove("ltr:left-0", "rtl:right-0");
|
navbarMenu.classList.remove("ltr:left-0", "rtl:right-0");
|
||||||
navbarMenu.classList.add("ltr:-left-80", "rtl:-right:80");
|
navbarMenu.classList.add("ltr:-left-80", "rtl:-right:80");
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<akaunting-search
|
<akaunting-search
|
||||||
placeholder="{{ (!empty($filters)) ? trans('general.placeholder.search_and_filter') : trans('general.search_placeholder')}}"
|
placeholder="{{ (!empty($filters)) ? trans('general.placeholder.search_and_filter') : trans('general.search_placeholder')}}"
|
||||||
|
select-placeholder="{{ trans('general.placeholder.select_and_filter') }}"
|
||||||
|
enter-placeholder="{{ trans('general.placeholder.enter_and_filter') }}"
|
||||||
search-text="{{ trans('general.search_text') }}"
|
search-text="{{ trans('general.search_text') }}"
|
||||||
operator-is-text="{{ trans('general.is') }}"
|
operator-is-text="{{ trans('general.is') }}"
|
||||||
operator-is-not-text="{{ trans('general.isnot') }}"
|
operator-is-not-text="{{ trans('general.isnot') }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user