Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,28 @@ function createShowQueue(initialRecallDelay = 500, recallDelayIncrement = 500) {
};
}

/** Helper functions */
function success(text, timeout, color) {
return show(text, "success", timeout, color);
}
function warn(text, timeout, color) {
return show(text, "warning", timeout, color);
}
function error(text, timeout, color) {
return show(text, "error", timeout, color);
}
function info(text, timeout, color) {
return show(text, "info", timeout, color);
}

/* Export notification functions */
export let notify = {
show,
hide,
success,
warn,
error,
info,
createShowQueue
};

Expand Down
9 changes: 3 additions & 6 deletions src/stylesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ class Stylesheet {
return {
container: {
position: 'fixed',
width: '50%',
margin: '0 auto',
right: '0px',
top: defaults.top,
left: '0px',
textAlign: 'center',
right: defaults.right || '0px',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you get rid of width, margin and textAlign values?

top: defaults.top || '0px',
left: defaults.left || '0px',
zIndex: defaults.zIndex,
pointerEvents: 'none',
transition: 'all ' + defaults.animationDuration + 'ms ease',
Expand Down