j-NotifyBar
- singlar
- Framgångsrik
SETTER('notifybar/success', 'MESSAGE') - Varning meddelande
SETTER('notifybar/warning', 'MESSAGE') - Information om
SETTER('notifybar/info', 'MESSAGE', '[BUTTON_LABEL]', [callback_dismiss])
Konfigurera:
timeout{Numret} En timout i millisekunder (default:4000)
Metoder:
component.success(message)skickar framgångsrik meddelandecomponent.warning(message)skickar ett varningsmeddelandecomponent.info(message)skickar informationcomponent.hide()döljer barencomponent.show()visar sista meddelandet
Arbetar med asetter:
- Fel hanteras automatiskt
// 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'));Använd den med <ui-component name="notifybar">När komponenten ännu inte är laddad, jComponent Ladda ner den första gången från adressen i DEF.fallback (en av Componentator Författare: Peter Širka. källa: The Componentator Komponenterna i lager, MIT licens.
<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>