notiflix / Notiflix

Notiflix is a pure JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more that makes your web projects much better.

Home Page:https://notiflix.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEAT] - Notifications from left and right do not work at the same time

malikdoksoz opened this issue · comments

commented

Version: 2.6.0

m.successNotification('Some noti', 2500, '14.5px', 'right-top', 'from-right');
m.successNotification('Some noti', 2500, '14.5px', 'left-top', 'from-left');

If the right is called before the notification on the left is closed, the notification appears on the left.

Notiflix.Notify.Init({
	fontFamily: 'Quicksand',
	useGoogleFont: true,
	closeButton: false,
	fontSize: '13px',
	width: '390px',
	plainText: false,
	// useFontAwesome: true,
	// fontAwesomeIconStyle: 'shadow',
	clickToClose: true,
	showOnlyTheLastOne: true,
	cssAnimationStyle: 'from-right',
	timeout: 2000,
	distance: '5px',
	position: 'right-top',
	messageMaxLength: 1000
});
var m = {
	successNotification: function(
		message,
		timeout = 2500,
		fontSize = '13px',
		position = 'right-top',
		cssAnimationStyle = 'from-right'
	) {
		Notiflix.Notify.Merge({
			timeout: timeout,
			fontSize: fontSize,
			position: position,
			cssAnimationStyle: cssAnimationStyle
		});
		Notiflix.Notify.Success(message);
	},
	errorNotification: function(
		message,
		timeout = 2500,
		fontSize = '13px',
		position = 'right-top',
		cssAnimationStyle = 'from-right'
	) {
		Notiflix.Notify.Merge({
			timeout: timeout,
			fontSize: fontSize,
			position: position,
			cssAnimationStyle: cssAnimationStyle
		});
		Notiflix.Notify.Failure(message);
	}
}

Hi @malikdoksoz

Firstly, thanks for using Notiflix.

The position option, is a common option for the Notify module as you can see in the documentation as well.
https://www.notiflix.com/documentation#DocsNotify

Unfortunately, you can not able to use the position option as different for each notification element at the same time.
So, you have to wait for all the existing notifications removal to set a new position for the next ones.

In addition, I noted this request as a "nice to have" feature for future updates.

Thanks.
Furkan.


Tip:
You can use the new options for each notification as a parameter with v2.3.1 and the next versions.
An example of usage is below.

// you do not have to use the Merge function for that,
Notiflix.Notify.Merge({
  timeout: timeout,
  fontSize: fontSize,
  position: position,
  cssAnimationStyle: cssAnimationStyle
});
Notiflix.Notify.Failure(message);

// v2.3.1 and the next versions:
Notiflix.Notify.Failure(message, {
  timeout: timeout,
  fontSize: fontSize,
  position: position,
  cssAnimationStyle: cssAnimationStyle
});
commented

Hi @malikdoksoz

Firstly, thanks for using Notiflix.

The position option, is a common option for the Notify module as you can see in the documentation as well.
https://www.notiflix.com/documentation#DocsNotify

Unfortunately, you can not able to use the position option as different for each notification element at the same time.
So, you have to wait for all the existing notifications removal to set a new position for the next ones.

In addition, I noted this request as a "nice to have" feature for future updates.

Thanks.
Furkan.

Tip: You can use the new options for each notification as a parameter with v2.3.1 and the next versions. An example of usage is below.

// you do not have to use the Merge function for that,
Notiflix.Notify.Merge({
  timeout: timeout,
  fontSize: fontSize,
  position: position,
  cssAnimationStyle: cssAnimationStyle
});
Notiflix.Notify.Failure(message);

// v2.3.1 and the next versions:
Notiflix.Notify.Failure(message, {
  timeout: timeout,
  fontSize: fontSize,
  position: position,
  cssAnimationStyle: cssAnimationStyle
});

Thank your for suggestion. In the next version, it would be great if added.