From 1c50a75f423afc807adcf2142abc732a5bfa49d5 Mon Sep 17 00:00:00 2001 From: Vadim Costin Date: Wed, 1 Jul 2015 15:25:00 +0300 Subject: [PATCH 1/6] add stackable nodifications in LSG --- .../stylesheets/content/_notifications.lsg | 56 +++++++++++++++++++ .../stylesheets/content/_notifications.sass | 7 +++ 2 files changed, 63 insertions(+) diff --git a/app/assets/stylesheets/content/_notifications.lsg b/app/assets/stylesheets/content/_notifications.lsg index 5aefdf30c3..2c10ae4622 100644 --- a/app/assets/stylesheets/content/_notifications.lsg +++ b/app/assets/stylesheets/content/_notifications.lsg @@ -46,3 +46,59 @@ ``` + +## Stackable + + +``` +
+
+ +
+
+
+ + +``` + +``` +@javascript +(function($){ + + var workArea = $('#example-zx00x'); + var viewArea = workArea.find('.content'); + var notificationMessageTemplate = { + notificationNumber: 0, + printNotification: function(){ + this.notificationNumber++; + return $('#warning-message-zx00x').html() + .replace(/{{number}}/g, this.notificationNumber); + } + }; + + $('#test-notifier').on('click', function(e){ + e.preventDefault(); + viewArea.prepend(notificationMessageTemplate.printNotification()); + }); + + $(document).on('click', '.notification-box--close', function(e){ + e.preventDefault(); + $(this).closest('.notification-box').animate({ + 'padding-top': 0, + 'padding-bottom': 0, + 'height': 0, + 'opacity': 0 + }, 300, function() { + $(this).remove(); + }); + }); + +})(jQuery); +``` diff --git a/app/assets/stylesheets/content/_notifications.sass b/app/assets/stylesheets/content/_notifications.sass index 4c5409b192..4e07dae6a0 100644 --- a/app/assets/stylesheets/content/_notifications.sass +++ b/app/assets/stylesheets/content/_notifications.sass @@ -81,6 +81,13 @@ $nm-padding-default-box: rem-calc(10px) background-color: $nm-color-default-background color: $nm-font-color + &.-stack-top-center + margin-left: auto + margin-right: auto + left: 0 + right: 0 + z-index: 9999 + & .button margin: rem-calc(10px 10px 0 0) From 32d6a02642bcb061a4d6375265039bcea7d6968a Mon Sep 17 00:00:00 2001 From: Vadim Costin Date: Thu, 2 Jul 2015 15:22:35 +0300 Subject: [PATCH 2/6] add bottom margin for stackable alert messages --- app/assets/stylesheets/content/_notifications.sass | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/content/_notifications.sass b/app/assets/stylesheets/content/_notifications.sass index 4e07dae6a0..242b180d10 100644 --- a/app/assets/stylesheets/content/_notifications.sass +++ b/app/assets/stylesheets/content/_notifications.sass @@ -86,6 +86,7 @@ $nm-padding-default-box: rem-calc(10px) margin-right: auto left: 0 right: 0 + margin-bottom: rem-calc(3px) z-index: 9999 & .button From 591428e1a74911480dcc27250b097fe228acb384 Mon Sep 17 00:00:00 2001 From: Vadim Costin Date: Thu, 2 Jul 2015 16:12:52 +0300 Subject: [PATCH 3/6] change the holder of notiffication messages --- .../stylesheets/content/_notifications.lsg | 17 +++++++-------- .../stylesheets/content/_notifications.sass | 21 ++++++++++++------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app/assets/stylesheets/content/_notifications.lsg b/app/assets/stylesheets/content/_notifications.lsg index 2c10ae4622..c39b93c73b 100644 --- a/app/assets/stylesheets/content/_notifications.lsg +++ b/app/assets/stylesheets/content/_notifications.lsg @@ -51,15 +51,15 @@ ``` -
-
- -
-
+
+ +
+
+