Skip to content

Commit

Permalink
Addressing #60
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee committed Apr 25, 2017
1 parent 1bb961c commit f8b2ba9
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions inc/class-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private function get_properties( $settings ) {
* @return string
*/
public function render_slider_preview( $ppb_html, $post_id ) {
if ( 'pootle-slider' != get_post_type( $post_id ) || ! did_action( 'wp_head' ) ) {
if ( 'pootle-slider' != get_post_type( $post_id ) || ! ( did_action( 'wp_head' ) || DOING_AJAX ) ) {
return $ppb_html;
} elseif ( Pootle_Page_Builder_Live_Editor_Public::is_active() ) {
return $this->prependLiveEditorBar( $post_id ) . $ppb_html;
Expand Down Expand Up @@ -152,7 +152,6 @@ public function render_slider_preview( $ppb_html, $post_id ) {

return
$this->prependPreviewBar( $post_id ) .
$this->style( $id, $post_id ) .
"<div class='$class' id='{$id}-wrap'>$pb</div>" .
$this->script( $id, $post_id );
}
Expand Down Expand Up @@ -184,12 +183,7 @@ private function prependLiveEditorBar( $post_id ) {
<?php
}

private function prependPreviewBar() {

}

private function style( $id ) {
}
private function prependPreviewBar() {}

private function get_ratio( $post_id ) {
$ratio = $this->ratio;
Expand All @@ -210,6 +204,6 @@ private function script( $id, $post_id ) {
$js_props .= ",$p:$v";
}
$js_props .= '}';
return "<script id='$id-script'>jQuery(function(){ window.pootleSliderInit( '#$id-wrap', $js_props, $ratio ); });</script>";
return "<script id='$id-script'>window.pootleSliderInit( '#$id-wrap', $js_props, $ratio );</script>";
}
}

0 comments on commit f8b2ba9

Please sign in to comment.