Skip to content

Commit 9d0d8fe

Browse files
committed
Merge pull request #14 from icai/master
Update bootstrap-growl.js
2 parents baeba6a + 7d2d706 commit 9d0d8fe

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

bootstrap-growl.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Bootstrap Growl - v1.0.6 - 2014-01-29
1+
/*! Bootstrap Growl - v1.0.6-(improve) 2014-01-29
22
* https://github.com/mouse0270/bootstrap-growl
33
* Copyright (c) 2014 Remable Designs; Licensed MIT */
44
;(function($, window, document, undefined) {
@@ -9,13 +9,14 @@
99
var message = null,
1010
title = null,
1111
icon = null,
12-
$growl, growlClass, css, offsetAmount;
12+
type = null,
13+
$growl, growlClass, growlAlertClass, css, offsetAmount;
1314

1415
if (typeof content == "object") {
1516
message = content.message;
1617
title = content.title ? " "+content.title+" " : null;
1718
icon = content.icon ? content.icon : null;
18-
options = content;
19+
options = $.extend(true, {}, content, options);
1920
}else{
2021
message = content;
2122
}
@@ -32,8 +33,9 @@
3233

3334
/* ===== BUILD GROWL CONTAINER ===== */
3435
growlClass = "bootstrap-growl-" + options.position.from + "-" + options.position.align;
36+
growlAlertClass = "growl-alert";
3537
$growl = $(options.template.container);
36-
$growl.addClass(growlClass);
38+
$growl.addClass(growlAlertClass).addClass(growlClass);
3739

3840
if (options.type) {
3941
$growl.addClass("alert-" + options.type);
@@ -43,6 +45,7 @@
4345

4446
if (options.allow_dismiss) {
4547
$growl.append($(options.template.dismiss));
48+
$growl.addClass('alert-dismissible');
4649
}
4750

4851
if (icon) {
@@ -161,7 +164,7 @@
161164
allow_dismiss: true,
162165
position: {
163166
from: "top",
164-
align: "right"
167+
align: "center"
165168
},
166169
offset: 20,
167170
spacing: 10,
@@ -175,12 +178,15 @@
175178
onGrowlClosed: null,
176179
template: {
177180
icon_type: 'class',
178-
container: '<div class="col-xs-10 col-sm-10 col-md-3 alert">',
179-
dismiss: '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>',
181+
container: '<div class="col-xs-10 col-sm-10 col-md-3 alert" role="alert">',
182+
dismiss: '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>',
180183
title: '<strong>',
181184
title_divider: '',
182185
message: ''
183186
}
184187
};
185188

189+
190+
191+
186192
})(jQuery, window, document);

bootstrap-growl.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)