Skip to content

Commit a266fbf

Browse files
committed
Merge pull request #211 from famaridon/bootstrapTheme
a bootstrap theme built with list-group component
2 parents 01d4e74 + 03d0fc3 commit a266fbf

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

js/noty/themes/bootstrap.js

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
(function($) {
2+
3+
$.noty.themes.bootstrapTheme = {
4+
name: 'bootstrapTheme',
5+
modal: {
6+
css: {
7+
position: 'fixed',
8+
width: '100%',
9+
height: '100%',
10+
backgroundColor: '#000',
11+
zIndex: 10000,
12+
opacity: 0.6,
13+
display: 'none',
14+
left: 0,
15+
top: 0
16+
}
17+
},
18+
style: function() {
19+
20+
var containerSelector = this.options.layout.container.selector;
21+
$(containerSelector).addClass('list-group');
22+
23+
this.$closeButton.append('<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>');
24+
this.$closeButton.addClass('close');
25+
26+
this.$bar.addClass( "list-group-item" );
27+
28+
switch (this.options.type) {
29+
case 'alert': case 'notification':
30+
this.$bar.addClass( "list-group-item-info" );
31+
break;
32+
case 'warning':
33+
this.$bar.addClass( "list-group-item-warning" );
34+
break;
35+
case 'error':
36+
this.$bar.addClass( "list-group-item-danger" );
37+
break;
38+
case 'information':
39+
this.$bar.addClass("list-group-item-info");
40+
break;
41+
case 'success':
42+
this.$bar.addClass( "list-group-item-success" );
43+
break;
44+
}
45+
},
46+
callback: {
47+
onShow: function() { },
48+
onClose: function() { }
49+
}
50+
};
51+
52+
})(jQuery);
53+

0 commit comments

Comments
 (0)