Removing Owl Carousel dependency
This commit is contained in:
parent
e793abacfb
commit
ef7c58099c
16
gulpfile.js
16
gulpfile.js
|
@ -146,7 +146,6 @@ gulp.task('watch-bs', ['browser-sync', 'watch', 'cssnano', 'scripts'], function
|
|||
// Uglifies and concat all JS files into one
|
||||
gulp.task('scripts', function() {
|
||||
var scripts = [
|
||||
basePaths.dev + 'js/owl.carousel.min.js', // Must be loaded before BS4
|
||||
basePaths.dev + 'js/tether.js', // Must be loaded before BS4
|
||||
|
||||
// Start - All BS4 stuff
|
||||
|
@ -198,21 +197,6 @@ gulp.task('copy-assets', ['clean-source'], function() {
|
|||
gulp.src(basePaths.node + 'font-awesome/scss/*.scss')
|
||||
.pipe(gulp.dest(basePaths.dev + '/sass/fontawesome'));
|
||||
|
||||
|
||||
// owl JS files
|
||||
gulp.src(basePaths.node + 'owl.carousel/dist/*.js')
|
||||
.pipe(gulp.dest(basePaths.dev + '/js'));
|
||||
|
||||
|
||||
// Copy all Owl2 SCSS files
|
||||
gulp.src(basePaths.node + 'owl.carousel/src/scss/*.scss')
|
||||
.pipe(gulp.dest(basePaths.dev + '/sass/owl-carousel2'));
|
||||
|
||||
// Copy all Owl2 CSS files
|
||||
gulp.src(basePaths.node + 'owl.carousel/dist/assets/*.css')
|
||||
.pipe(gulp.dest(basePaths.dev + '/css'));
|
||||
|
||||
|
||||
// Copy jQuery
|
||||
gulp.src(basePaths.node + 'jquery/dist/*.js')
|
||||
.pipe(gulp.dest(basePaths.dev + '/js'));
|
||||
|
|
|
@ -22,30 +22,3 @@ if ( ! function_exists( 'understrap_scripts' ) ) {
|
|||
} // endif function_exists( 'understrap_scripts' ).
|
||||
|
||||
add_action( 'wp_enqueue_scripts', 'understrap_scripts' );
|
||||
|
||||
/**
|
||||
*Loading slider script conditionally
|
||||
*/
|
||||
|
||||
if ( is_active_sidebar( 'hero' ) ) :
|
||||
add_action( 'wp_enqueue_scripts', 'understrap_slider' );
|
||||
|
||||
if ( ! function_exists( 'understrap_slider' ) ) {
|
||||
/**
|
||||
* Setup slider.
|
||||
*/
|
||||
function understrap_slider() {
|
||||
if ( is_front_page() ) {
|
||||
$data = array(
|
||||
'timeout' => intval( get_theme_mod( 'understrap_theme_slider_time_setting', 5000 ) ),
|
||||
'items' => intval( get_theme_mod( 'understrap_theme_slider_count_setting', 1 ) ),
|
||||
);
|
||||
|
||||
wp_enqueue_script( 'understrap-slider-script',
|
||||
get_stylesheet_directory_uri() . '/js/slider_settings.js', array() );
|
||||
wp_localize_script( 'understrap-slider-script', 'understrap_slider_variables', $data );
|
||||
}
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
jQuery(document).ready(function() {
|
||||
var owl = jQuery('.owl-carousel');
|
||||
owl.owlCarousel({
|
||||
items:1,
|
||||
loop:true,
|
||||
autoplay:true,
|
||||
autoplayTimeout:5000,
|
||||
animateOut: 'fadeOut',
|
||||
animateIn: 'fadeIn',
|
||||
nav: false,
|
||||
dots: true,
|
||||
autoplayHoverPause:true,
|
||||
margin:0,
|
||||
autoHeight:true
|
||||
});
|
||||
|
||||
jQuery('.play').on('click',function(){
|
||||
owl.trigger('autoplay.play.owl',[1000])
|
||||
});
|
||||
jQuery('.stop').on('click',function(){
|
||||
owl.trigger('autoplay.stop.owl')
|
||||
});
|
||||
});
|
|
@ -42,7 +42,6 @@
|
|||
"gulp-uglify": "^2.0.0",
|
||||
"gulp-watch": "^4.3.11",
|
||||
"merge2": "^1.0.3",
|
||||
"owl.carousel": "^2.2.0",
|
||||
"run-sequence": "^1.2.2",
|
||||
"undescores-for-npm": "^1.0.0"
|
||||
},
|
||||
|
|
|
@ -127,6 +127,7 @@ button,
|
|||
// Clearing after widget
|
||||
aside.widget{clear:both;}
|
||||
|
||||
// Makes widgets in hero slider 100% width
|
||||
#wrapper-hero .carousel-inner .textwidget {
|
||||
width:100%;
|
||||
}
|
Reference in New Issue