Skip to content

Commit 6767cde

Browse files
committed
Merge pull request #29 from joelcuevas/develop
Delaying visibility divs container until document ready
2 parents c73939b + 6e941d5 commit 6767cde

File tree

4 files changed

+31
-26
lines changed

4 files changed

+31
-26
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
### Changelog
22

3+
**2.5.1**
4+
Delaying the injection of visibility divs container into `body` until `$(document).ready()`, and thus allowing the inclusion of library inside `<head>` section.
5+
36
**2.5.0**
47
Introduced `use` method allowing to use custom visibility classes. Added built-in Foundation 5 support.
58

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "responsive-bootstrap-toolkit",
3-
"version": "2.5.0",
3+
"version": "2.5.1",
44
"homepage": "https://github.com/maciej-gurban/responsive-bootstrap-toolkit",
55
"description": "Responsive Bootstrap Toolkit provides an easy way of breakpoint detection in JavaScript, detecting changes in currently active breakpoint, as well as executing any breakpoint-specific JavaScript code.",
66
"main": "dist/bootstrap-toolkit.js",

dist/bootstrap-toolkit.js

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,33 @@ var ResponsiveBootstrapToolkit = (function($){
1313
/**
1414
* Breakpoint detection divs for each framework version
1515
*/
16-
detectionDivs: {
17-
// Bootstrap 3
18-
bootstrap: {
19-
'xs': $('<div class="device-xs visible-xs visible-xs-block"></div>'),
20-
'sm': $('<div class="device-sm visible-sm visible-sm-block"></div>'),
21-
'md': $('<div class="device-md visible-md visible-md-block"></div>'),
22-
'lg': $('<div class="device-lg visible-lg visible-lg-block"></div>')
23-
},
24-
// Foundation 5
25-
foundation: {
26-
'small': $('<div class="device-xs show-for-small-only"></div>'),
27-
'medium': $('<div class="device-sm show-for-medium-only"></div>'),
28-
'large': $('<div class="device-md show-for-large-only"></div>'),
29-
'xlarge': $('<div class="device-lg show-for-xlarge-only"></div>')
30-
}
31-
},
16+
detectionDivs: {
17+
// Bootstrap 3
18+
bootstrap: {
19+
'xs': $('<div class="device-xs visible-xs visible-xs-block"></div>'),
20+
'sm': $('<div class="device-sm visible-sm visible-sm-block"></div>'),
21+
'md': $('<div class="device-md visible-md visible-md-block"></div>'),
22+
'lg': $('<div class="device-lg visible-lg visible-lg-block"></div>')
23+
},
24+
// Foundation 5
25+
foundation: {
26+
'small': $('<div class="device-xs show-for-small-only"></div>'),
27+
'medium': $('<div class="device-sm show-for-medium-only"></div>'),
28+
'large': $('<div class="device-md show-for-large-only"></div>'),
29+
'xlarge': $('<div class="device-lg show-for-xlarge-only"></div>')
30+
}
31+
},
3232

3333
/**
3434
* Append visibility divs after DOM laoded
3535
*/
36-
applyDetectionDivs: function() {
37-
$(document).ready(function(){
38-
$.each(self.breakpoints, function(alias){
39-
self.breakpoints[alias].appendTo('.responsive-bootstrap-toolkit');
40-
});
41-
});
42-
},
36+
applyDetectionDivs: function() {
37+
$(document).ready(function(){
38+
$.each(self.breakpoints, function(alias){
39+
self.breakpoints[alias].appendTo('.responsive-bootstrap-toolkit');
40+
});
41+
});
42+
},
4343

4444
/**
4545
* Determines whether passed string is a parsable expression
@@ -221,7 +221,9 @@ var ResponsiveBootstrapToolkit = (function($){
221221
};
222222

223223
// Create a placeholder
224-
$('<div class="responsive-bootstrap-toolkit"></div>').appendTo('body');
224+
$(document).ready(function(){
225+
$('<div class="responsive-bootstrap-toolkit"></div>').appendTo('body');
226+
});
225227

226228
if( self.framework === null ) {
227229
self.use('bootstrap');

dist/bootstrap-toolkit.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)