Skip to content

Commit

Permalink
Target first!
Browse files Browse the repository at this point in the history
Permitir informar se o toast será o primeiro da lista ou se será adicionando ao final.
  • Loading branch information
emtudo authored Nov 30, 2016
1 parent f5c8c0a commit d36842b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dist/js/iziToast.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
rtl: false,
position: 'bottomRight', // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center
target: '',
targetFirst: false,
timeout: 5000,
pauseOnHover: true,
resetOnHover: false,
Expand Down Expand Up @@ -604,7 +605,11 @@

$wrapper = document.querySelector(settings.target);
$wrapper.classList.add(PLUGIN_NAME + '-target');
$wrapper.appendChild($toastCapsule);
if (settings.targetFirst) {
$wrapper.insertBefore($toastCapsule, $wrapper.firstChild);
} else {
$wrapper.appendChild($toastCapsule);
}

} else {

Expand Down

0 comments on commit d36842b

Please sign in to comment.