Skip to content

Commit

Permalink
#2711 Added in master
Browse files Browse the repository at this point in the history
  • Loading branch information
pegazee committed Apr 23, 2019
1 parent 923fd0b commit 0c04d63
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions pagebuilder/inc/viewShowFrontData.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function amp_pagebuilder_script_loader($scriptData){
function amp_pagebuilder_content_styles(){
//To load css of modules which are in use
global $redux_builder_amp, $moduleTemplate, $post, $containerCommonSettings;

$completeCssOfPB = '';
$postId = (is_object($post)? $post->ID: '');
if( ampforwp_is_front_page() ) {
$postId = ampforwp_get_frontpage_id();
Expand All @@ -146,7 +146,7 @@ function amp_pagebuilder_content_styles(){
$ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
if($previousData!="" && $ampforwp_pagebuilder_enable=='yes'){

echo '.amp_pb{display: inline-block;width: 100%;}
$completeCssOfPB .= '.amp_pb{display: inline-block;width: 100%;}
.row{display: inline-flex;width: 100%;}
.col-2{width:50%;float:left;}
.cb{clear:both;}
Expand Down Expand Up @@ -278,7 +278,7 @@ function amp_pagebuilder_content_styles(){
//}
$rowCss = ampforwp_replaceIfContentConditional($rowfield['name'], $replaceRow, $rowCss);
}
echo amppb_validateCss($rowCss);
$completeCssOfPB .= $rowCss;
}//Row Settings Css foreach closed

if(count($container)>0){
Expand Down Expand Up @@ -402,7 +402,7 @@ function amp_pagebuilder_content_styles(){

$completeCss = ampforwp_replaceIfContentConditional($modulefield['name'], $replaceModule, $completeCss);
}
echo amppb_validateCss($completeCss);
$completeCssOfPB .= $completeCss;

//For Repeater Fields
$repeaterFieldsCss = '';
Expand Down Expand Up @@ -467,15 +467,15 @@ function amp_pagebuilder_content_styles(){
}//If Check for Fall back

}//If for Module is repeater or not
echo $repeaterFieldsCss;
$completeCssOfPB .= $repeaterFieldsCss;



}//foreach content closed

//For Comon CSS
if(count($moduleCommonCss)>0){
echo implode(" ", $moduleCommonCss);
$completeCssOfPB .= implode(" ", $moduleCommonCss);
}

}//ic container check closed
Expand All @@ -487,9 +487,10 @@ function amp_pagebuilder_content_styles(){
}//if closed count($previousData['rows'])>0

if(isset($previousData['settingdata']['style_data']) && $previousData['settingdata']['style_data']!=""){
echo amppb_validateCss($previousData['settingdata']['style_data']);
$completeCssOfPB .= $previousData['settingdata']['style_data'];
}
}//If Closed $previousData!="" && $ampforwp_pagebuilder_enable=='yes'
echo amppb_validateCss($completeCssOfPB);
}
function amppb_validateCss($css){
$css = (esc_html($css));
Expand All @@ -499,6 +500,7 @@ function amppb_validateCss($css){
$css = preg_replace('/(([a-z -]*:(\s)*;))/', "", $css);
$css = preg_replace('/((;[\s\n;]*;))/', ";", $css);
$css = preg_replace('/(?:[^\r\n,{}]+)(?:,(?=[^}]*{,)|\s*{[\s]*})/', "", $css);
$css = preg_replace('/\s\n+/', "", $css);
return ampforwp_pb_autoCompileLess($css);
}

Expand Down
2 changes: 1 addition & 1 deletion templates/design-manager/swift/style.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
<?php if($redux_builder_amp['single-design-type'] == '1' || $redux_builder_amp['single-design-type'] == '4'){?>
<?php // Single

if(is_single() ) { ?>
if(is_single() && !checkAMPforPageBuilderStatus(ampforwp_get_the_ID())) { ?>
table {
display: -webkit-box;
overflow-x: auto;
Expand Down

0 comments on commit 0c04d63

Please sign in to comment.