gedel-dialog
v0.0.55
Published
Simple modal dialog window with buttons
Downloads
16
Maintainers
Readme
dialog-window
Библиотека для создания диалоговых окон с одной функцией.
Возможности:
- открывает окно в центре экрана поверх всего
- под окном - тень, которая не дает реагировать на нижележащие объекты
- кастомный дизайн (тупо описать классы CSS - и подключать их позже)
- в окне может быть куча кнопок
Функционал: → GedelDialog.make({Объект с опциями}); - создает новый диалог → GedelDialog.destroy(); - уничтожает диалог
Пример использования:
GedelDialog.make({
id: "gedel", // Кастомный ID, если отсутсвует береться по умолчанию
class: { // Классы для диалога: (Необязателен)
wrapper: "dialog-wrapper", // обертка
window: "dialog-window", // окно
title: "dialog-title", // заголовок
text: "dialog-text", // текст
buttonsWrap: "dialog-buttons-wrap", // обертка кнопок
button: "dialog-button" // кнопка
},
title: "Заголовок", // Заголовок диалога
text: "Текст", // Текст диалога
buttons: [ // Массив с параметрами кнопок
{
label: "Первая кнопка", // Заголовок кнопки
action: () => { // Сюда помещается функция
console.log("Первая кнопка")
}
},
{
label: "Вторая кнопка",
action: () => {
console.log("Вторая кнопка.")
}
}
]
});