Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

2 new layout: bottomLeft, bottomRight. 1 new option closeOnSelfHover

  • Loading branch information...
commit 8dcb7c189d72a44228ccc16521a47d95ebb0d2fd 1 parent c257016
@needim authored
View
12 css/jquery.noty.css
@@ -49,7 +49,6 @@
padding: 0px;
list-style: none;
width: 300px;
- top: 20px;
}
ul.noty_container li {
position: relative;
@@ -60,8 +59,10 @@
margin: 10px 0 0 0;
width: 300px; /* Fix for: http://bugs.jquery.com/ticket/2278 */
}
- ul.noty_container.noty_layout_topLeft {left:20px}
- ul.noty_container.noty_layout_topRight {right:40px}
+ ul.noty_container.noty_layout_topLeft {left:20px; top:20px;}
+ ul.noty_container.noty_layout_topRight {right:40px; top:20px;}
+ ul.noty_container.noty_layout_bottomLeft {left:20px; bottom:20px}
+ ul.noty_container.noty_layout_bottomRight {right:40px; bottom:20px}
ul.noty_container.noty_layout_topRight li {float:right}
/* LAYOUTS */
@@ -86,7 +87,10 @@
}
/* noty_layout_topLeft & noty_layout_topRight */
- .noty_bar.noty_layout_topLeft, .noty_bar.noty_layout_topRight {
+ .noty_bar.noty_layout_topLeft,
+ .noty_bar.noty_layout_topRight,
+ .noty_bar.noty_layout_bottomLeft,
+ .noty_bar.noty_layout_bottomRight {
width: 100%;
clear: both;
position: relative;
View
12 css/noty_theme_default.css
@@ -70,7 +70,9 @@
/* noty_layout_topLeft & noty_layout_topRight */
.noty_bar.noty_theme_default.noty_layout_topLeft,
- .noty_bar.noty_theme_default.noty_layout_topRight {
+ .noty_bar.noty_theme_default.noty_layout_topRight,
+ .noty_bar.noty_theme_default.noty_layout_bottomLeft,
+ .noty_bar.noty_theme_default.noty_layout_bottomRight {
padding: 4px;
border: 3px solid #eee;
-webkit-border-radius: 5px;
@@ -78,12 +80,16 @@
border-radius: 5px;
}
.noty_bar.noty_theme_default.noty_layout_topLeft .noty_close,
- .noty_bar.noty_theme_default.noty_layout_topRight .noty_close {
+ .noty_bar.noty_theme_default.noty_layout_topRight .noty_close,
+ .noty_bar.noty_theme_default.noty_layout_bottomLeft .noty_close,
+ .noty_bar.noty_theme_default.noty_layout_bottomRight .noty_close {
right: -9px;
top: -10px;
}
.noty_bar.noty_theme_default.noty_layout_topLeft .noty_message .noty_buttons,
- .noty_bar.noty_theme_default.noty_layout_topRight .noty_message .noty_buttons {
+ .noty_bar.noty_theme_default.noty_layout_topRight .noty_message .noty_buttons,
+ .noty_bar.noty_theme_default.noty_layout_bottomLeft .noty_message .noty_buttons,
+ .noty_bar.noty_theme_default.noty_layout_bottomRight .noty_message .noty_buttons {
float: none;
font-size: 13px;
border-top: 1px solid #CCCCCC;
View
2  css/noty_theme_mitgux.css
@@ -67,6 +67,8 @@
}
.noty_bar.noty_theme_mitgux.noty_layout_topLeft .noty_message,
.noty_bar.noty_theme_mitgux.noty_layout_topRight .noty_message,
+.noty_bar.noty_theme_mitgux.noty_layout_bottomLeft .noty_message,
+.noty_bar.noty_theme_mitgux.noty_layout_bottomRight .noty_message,
.noty_bar.noty_theme_mitgux.noty_layout_topCenter .noty_message {
padding-left: 60px;
padding-right: 40px;
View
17 js/jquery.noty.js
@@ -22,7 +22,7 @@
base.options.type = 'noty_'+base.options.type;
// Push notification to queue
- if (base.options.layout != 'noty_layout_topLeft' && base.options.layout != 'noty_layout_topRight') {
+ if (jQuery.inArray(base.options.layout, $.noty.growls) == -1) {
if (base.options.force) {
$.noty.queue.unshift({options: base.options});
} else {
@@ -48,7 +48,7 @@
if (jQuery.type(notification) === 'object') {
// Layout spesific container settings
- if (notification.options.layout == "noty_layout_topLeft" || notification.options.layout == "noty_layout_topRight") {
+ if (jQuery.inArray(base.options.layout, $.noty.growls) > -1) {
if ($("ul.noty_container."+notification.options.layout).length > 0) {
base.$noty_container = $("ul.noty_container."+notification.options.layout);
} else {
@@ -88,12 +88,17 @@
if (notification.options.buttons) {
notification.options.closeOnSelfClick = false;
}
-
+
// Close on self click
if (notification.options.closeOnSelfClick) {
$noty.find('.noty_message').bind('click', function() { $noty.triggerHandler('noty.close'); }).css('cursor', 'pointer');
}
+ // Close on self click
+ if (notification.options.closeOnSelfOver) {
+ $noty.find('.noty_message').bind('mouseover', function() { $noty.triggerHandler('noty.close'); }).css('cursor', 'pointer');
+ }
+
// is Modal?
if (notification.options.modal) {
$('<div />').addClass('noty_modal').addClass(notification.options.theme).prependTo($('body')).fadeIn('fast');
@@ -119,7 +124,7 @@
.promise().done(function() {
// Layout spesific cleaning
- if (options.layout == 'noty_layout_topLeft' || options.layout == 'noty_layout_topRight') {
+ if (jQuery.inArray(base.options.layout, $.noty.growls) > -1) {
$noty.parent().remove();
} else {
$noty.remove();
@@ -180,7 +185,8 @@
};
$.noty.queue = [];
-
+ $.noty.growls = ['noty_layout_topLeft', 'noty_layout_topRight', 'noty_layout_bottomLeft', 'noty_layout_bottomRight'];
+
$.noty.clearQueue = function () {
$.noty.queue = [];
};
@@ -208,6 +214,7 @@
timeout : 5000,
closable : false,
closeOnSelfClick : true,
+ closeOnSelfOver : false,
force : false,
onShow : false,
onClose : false,
Please sign in to comment.
Something went wrong with that request. Please try again.