$(document).ready(function(){
//Add checkbox to the page
$('body').append('
Rows & cols
');
//Check if checkbox is checked
$('input[name="gridlinetoggle"]').change(function() {
if(this.checked) {
$('.row').each(function() {
$(this).addClass( "rowCustom" );
var currentElement = $(this);
$( $(this) ).prepend( "Row" );
});
$('.row [class*="col-"]:not(.grid-column)').each(function() {
var currentElement = $(this);
var classes = currentElement.attr("class");
var responsiveclasses = classes.allReplace({'col-xs-': 'Mobile:', 'col-sm-': 'Tablet:', 'col-md-': 'Desktop:', 'col-lg-':'Large Desktop:'});
$( $(this) ).prepend( "Colomn i
" );
});
}
else{
$('.labelrow').each(function() {
$(this).remove();
});
$('.labelcol').each(function() {
$(this).remove();
});
$( ".row" ).removeClass( "rowCustom" );
}
});
//$("[data-toggle='popover']").popover();
$("[data-toggle='tooltip']").tooltip({
template: ''
});
$('head').append('');
})
String.prototype.allReplace = function(obj) {
var retStr = this;
for (var x in obj) {
retStr = retStr.replace(new RegExp(x, 'g'), obj[x]);
}
return retStr;
};