Skip to content

Commit

Permalink
Merge pull request marcelodolza#11 from emtudo/patch-2
Browse files Browse the repository at this point in the history
Target first!
  • Loading branch information
marcelodolza authored Jan 8, 2017
2 parents 1073717 + d36842b commit e714e9f
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 @@ -596,7 +597,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 e714e9f

Please sign in to comment.