|
1 | | -/*! Bootstrap Growl - v1.0.6 - 2014-01-29 |
| 1 | +/*! Bootstrap Growl - v1.0.6-(improve) 2014-01-29 |
2 | 2 | * https://github.com/mouse0270/bootstrap-growl |
3 | 3 | * Copyright (c) 2014 Remable Designs; Licensed MIT */ |
4 | 4 | ;(function($, window, document, undefined) { |
|
9 | 9 | var message = null, |
10 | 10 | title = null, |
11 | 11 | icon = null, |
12 | | - $growl, growlClass, css, offsetAmount; |
| 12 | + type = null, |
| 13 | + $growl, growlClass, growlAlertClass, css, offsetAmount; |
13 | 14 |
|
14 | 15 | if (typeof content == "object") { |
15 | 16 | message = content.message; |
16 | 17 | title = content.title ? " "+content.title+" " : null; |
17 | 18 | icon = content.icon ? content.icon : null; |
18 | | - options = content; |
| 19 | + options = $.extend(true, {}, content, options); |
19 | 20 | }else{ |
20 | 21 | message = content; |
21 | 22 | } |
|
32 | 33 |
|
33 | 34 | /* ===== BUILD GROWL CONTAINER ===== */ |
34 | 35 | growlClass = "bootstrap-growl-" + options.position.from + "-" + options.position.align; |
| 36 | + growlAlertClass = "growl-alert"; |
35 | 37 | $growl = $(options.template.container); |
36 | | - $growl.addClass(growlClass); |
| 38 | + $growl.addClass(growlAlertClass).addClass(growlClass); |
37 | 39 |
|
38 | 40 | if (options.type) { |
39 | 41 | $growl.addClass("alert-" + options.type); |
|
43 | 45 |
|
44 | 46 | if (options.allow_dismiss) { |
45 | 47 | $growl.append($(options.template.dismiss)); |
| 48 | + $growl.addClass('alert-dismissible'); |
46 | 49 | } |
47 | 50 |
|
48 | 51 | if (icon) { |
|
161 | 164 | allow_dismiss: true, |
162 | 165 | position: { |
163 | 166 | from: "top", |
164 | | - align: "right" |
| 167 | + align: "center" |
165 | 168 | }, |
166 | 169 | offset: 20, |
167 | 170 | spacing: 10, |
|
175 | 178 | onGrowlClosed: null, |
176 | 179 | template: { |
177 | 180 | 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">×</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>', |
180 | 183 | title: '<strong>', |
181 | 184 | title_divider: '', |
182 | 185 | message: '' |
183 | 186 | } |
184 | 187 | }; |
185 | 188 |
|
| 189 | + |
| 190 | + |
| 191 | + |
186 | 192 | })(jQuery, window, document); |
0 commit comments