V
V
Vitaly2017-06-05 15:16:52
JavaScript
Vitaly, 2017-06-05 15:16:52

How to wrap a line in Sweet Alert?

I tried to transfer like this:

$tags = "swal('Тэги', '%name% - Имя и фамилия пользователя. Пример : Иван Иванов/n %fname% - Имя пользователя. Пример : Иван %lname% - Фамилия пользователя. Пример : Иванов %date% - Текущая дата. Пример : 29.05.17 %time% - Текущее время. Пример : 20:15/n %uid% - ID пользователя. Пример : 206608447 %gid% - ID группы. Пример : 142342685/n %domain% - Короткое имя пользователя. Пример : avtorlego')";

But doesn't work. These / n are displayed as text and do not wrap the line at all ...
How can I do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Bogachev, 2018-10-01
@sfi0zy

A mousemovehandler is attached to the event, which adds the transform: translatenecessary elements. As in this example , but only the transformation is applied to the link image container, not to the eyes.

S
Spol50, 2020-12-18
@Spol50

You can make it work by \n
- You need to open JS.
- search for "e.initTitle"
- change to be like this:
-------------------------------------------------- ----------------------
e.initTitle = function (t) {
if (t) {
var e = document.createDocumentFragment();
t.split("\n").forEach(function (t, n, o) {
e.appendChild(document.createTextNode(t)), n < o.length - 1 && e.appendChild(document.createElement(" br"))
});
var n = r.injectElIntoModal(o.titleMarkup); n.appendChild(e), i(n)
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question