Fixed themes
This commit is contained in:
parent
bcad805727
commit
038b7d627c
@ -25,7 +25,6 @@ const dropdown = new CGSelect({
|
||||
width: '824px',
|
||||
},
|
||||
},
|
||||
// multiselect: true,
|
||||
});
|
||||
|
||||
dropdown.on('clear', function (e) {
|
||||
|
2
index.js
2
index.js
@ -1,3 +1,3 @@
|
||||
import { CGSelect } from './src/cg-select';
|
||||
import { CGSelect } from './src/cg-select.ts';
|
||||
|
||||
export default CGSelect;
|
||||
|
@ -5,26 +5,27 @@ export function changeTheme(element: Element, theme: string) {
|
||||
const search = element!.querySelector('.inputSearch');
|
||||
const path = element.querySelectorAll('.pathWhite');
|
||||
|
||||
select!.classList.remove('classicSelect');
|
||||
list!.classList.remove('classicList');
|
||||
path.forEach((elem) => {
|
||||
elem.classList.remove('pathBlack');
|
||||
elem.classList.remove('pathWhite');
|
||||
});
|
||||
|
||||
switch (theme) {
|
||||
case 'dark':
|
||||
select!.classList.remove('classicSelect');
|
||||
select!.classList.add('selectDark');
|
||||
list!.classList.add('listDark');
|
||||
list!.classList.remove('classicList');
|
||||
path.forEach((elem) => {
|
||||
elem.classList.remove('pathBlack');
|
||||
elem.classList.add('pathWhite');
|
||||
});
|
||||
break;
|
||||
case 'white':
|
||||
select!.classList.remove('classicSelect');
|
||||
select!.classList.add('selectWhite');
|
||||
caret!.classList.add('caretWhite');
|
||||
list!.classList.add('listWhite');
|
||||
list!.classList.remove('classicList');
|
||||
path.forEach((elem) => {
|
||||
elem.classList.add('pathBlack');
|
||||
elem.classList.remove('pathWhite');
|
||||
});
|
||||
|
||||
if (search!) {
|
||||
|
@ -27,7 +27,7 @@ export interface ICgSelect {
|
||||
items?: IItems[] | string[] | any;
|
||||
/**
|
||||
* An optional parameter responsible for switching between different themes, the classic theme is set by default.
|
||||
* @type {string}
|
||||
* @type {string} values: dark, white
|
||||
*/
|
||||
theme?: string;
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user