ForgeКомпоненти
bg

Компоненти

j-NotifyBar

jComponent 20 · jcomponent@20 component Примерът е зареден с jComponent 20
  • Синглът
  • Съобщение за успех SETTER('notifybar/success', 'MESSAGE')
  • Предоставяне на сигнал SETTER('notifybar/warning', 'MESSAGE')
  • Информация за SETTER('notifybar/info', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])

Конфигуриране:

  • timeout Времето в милисекунди (предварително: 4000)

Методи:

  • component.success(message) Послание за успех
  • component.warning(message) добавя предупредително съобщение
  • component.info(message) добавя съобщение
  • component.hide() Скрийте барът
  • component.show() показва последното съобщение

Работи с астероид:

  • Грешките се обработват автоматично
// Without callback
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', 'Profile has been saved successfully'));

// Or with a callback
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', 'Profile has been saved successfully', function(response) {
	console.log(response);
}));

// Or with a callback and without message
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', function(response) {
	console.log(response);
}));

// With auto-binding
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', '?.response'));
AJAX('POST /api/profile/', userprofile, ASETTER('notifybar/response', 'Your message', '?.response'));

Използвайте го с <ui-component name="notifybar">Когато компонентът все още не е зареден, jComponent Изтегляне на първия адрес в DEF.fallback (След това Componentator Източник: Питър Шерка Componentator Съставни съставки, лиценз на MIT.

example.html
<ui-component name="notifybar"></ui-component>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia harum accusamus debitis aut sunt, deserunt magni alias neque unde reprehenderit ipsa ea laboriosam eveniet! Distinctio pariatur sed, a aut nobis.

<script>
	setTimeout(function() {
		SETTER('notifybar/success', 'Lorem ipsum dolor sit amet.');
	}, 1000);

	setTimeout(function() {
		SETTER('notifybar/warning', 'Lorem ipsum dolor sit amet.');
	}, 2000);
</script>