From 2d566bd285f0121b4cd7b9ffc80df44f4877ec8e Mon Sep 17 00:00:00 2001 From: Yusein Yuseinov Date: Fri, 8 Jun 2012 15:01:48 +0300 Subject: [PATCH 1/2] Addeded css style for bottom-right, bottom-left and bottom-center positions. If position is bottom-* then prepend, else append. --- src/main/javascript/jquery.toastmessage.js | 14 +++++++++++++- .../resources/css/jquery.toastmessage.css | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/javascript/jquery.toastmessage.js b/src/main/javascript/jquery.toastmessage.js index 9317dd7..45e6227 100644 --- a/src/main/javascript/jquery.toastmessage.js +++ b/src/main/javascript/jquery.toastmessage.js @@ -83,9 +83,21 @@ // declare variables var toastWrapAll, toastItemOuter, toastItemInner, toastItemClose, toastItemImage; + var dashPos = localSettings.position.indexOf("-"); + var statusPosName = localSettings.position.substring(0,dashPos); + toastWrapAll = (!$('.toast-container').length) ? $('
').addClass('toast-container').addClass('toast-position-' + localSettings.position).appendTo('body') : $('.toast-container'); toastItemOuter = $('
').addClass('toast-item-wrapper'); - toastItemInner = $('
').hide().addClass('toast-item toast-type-' + localSettings.type).appendTo(toastWrapAll).html($('

').append (localSettings.text)).animate(localSettings.inEffect, localSettings.inEffectDuration).wrap(toastItemOuter); + + //if position is bottom, then prepend + if (statusPosName == 'bottom') { + toastItemInner = $('

').hide().addClass('toast-item toast-type-' + localSettings.type).prependTo(toastWrapAll).html($('

').append (localSettings.text)).animate(localSettings.inEffect, localSettings.inEffectDuration).wrap(toastItemOuter); + } else { + + //if position is not bottom - (middle OR top), then append message + toastItemInner = $('

').hide().addClass('toast-item toast-type-' + localSettings.type).appendTo(toastWrapAll).html($('

').append (localSettings.text)).animate(localSettings.inEffect, localSettings.inEffectDuration).wrap(toastItemOuter); + } + toastItemClose = $('

').addClass('toast-item-close').prependTo(toastItemInner).html(localSettings.closeText).click(function() { $().toastmessage('removeToast',toastItemInner, localSettings) }); toastItemImage = $('
').addClass('toast-item-image').addClass('toast-item-image-' + localSettings.type).prependTo(toastItemInner); diff --git a/src/main/resources/css/jquery.toastmessage.css b/src/main/resources/css/jquery.toastmessage.css index a68683f..66f17c2 100644 --- a/src/main/resources/css/jquery.toastmessage.css +++ b/src/main/resources/css/jquery.toastmessage.css @@ -140,3 +140,22 @@ margin-top: -40px; top: 50%; } + +.toast-position-bottom-left { + position: fixed; + left: 20px; + bottom: 20px; +} + +.toast-position-bottom-center { + position: fixed; + bottom: 20px; + left: 50%; + margin-left: -140px; +} + +.toast-position-bottom-right { + position: fixed; + bottom: 20px; + right: 20px; +} \ No newline at end of file From 8ff1a0500b94bc6f79dc01f5d7a47dc72bf194c7 Mon Sep 17 00:00:00 2001 From: Yusein Yuseinov Date: Wed, 24 Sep 2014 17:38:43 +0300 Subject: [PATCH 2/2] bugFix .gitignore --- .gitignore | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c59c35a..ada64ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -*.iml -/target/ -/.idea/ -*.iws -*.ipr \ No newline at end of file +/.project +/.buildpath +/.settings +/.git