Skip to content

Commit

Permalink
fix templates, javascript dependencies for work page, need to concat …
Browse files Browse the repository at this point in the history
…styles
  • Loading branch information
briankelleher committed Mar 22, 2016
1 parent 6d613bd commit ebbe4a3
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 4 deletions.
5 changes: 4 additions & 1 deletion www/wp-content/themes/ation2016/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ function add_to_twig( $twig ) {
function loadScripts() {
wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/static/vendor/bootstrap.min.css' );
wp_enqueue_style( 'main', get_template_directory_uri() . '/static/styles/site.min.css' );
wp_enqueue_script( 'main', get_template_directory_uri() . '/static/scripts/main.min.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'imagesloaded', get_template_directory_uri() . '/static/scripts/imagesLoaded.min.js', array('jquery'), '1.0.0', true );
wp_enqueue_script( 'isotope', get_template_directory_uri() . '/static/scripts/isotope.min.js', array('jquery', 'imagesloaded'), '1.0.0', true );
wp_enqueue_script( 'cells-by-row', get_template_directory_uri() . '/static/scripts/cells-by-row.min.js', array('jquery', 'isotope'), '1.0.0', true );
wp_enqueue_script( 'main', get_template_directory_uri() . '/static/scripts/main.min.js', array('jquery','isotope','cells-by-row', 'imagesloaded'), '1.0.0', true );
}

}
Expand Down
1 change: 0 additions & 1 deletion www/wp-content/themes/ation2016/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ gulp.task('scripts', function(){
}}))
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(concat('main.js'))
.pipe(gulp.dest('static/scripts/'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
Expand Down
24 changes: 24 additions & 0 deletions www/wp-content/themes/ation2016/src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,28 @@ jQuery( document ).ready( function( $ ) {
}
});

// Block grid
var $blocks = $('.blocks');

// Initialize isotope options
$blocks.isotope({ percentPosition: true, itemSelector: '.block', columnWidth: '.block' });

// Redo layout once each image is loaded
$blocks.imagesLoaded().progress( function() {
$blocks.isotope('layout');
});

// Filter grid items based on their work category, on the click of a filter
$('.work-bar a').click( function(e) {
e.preventDefault();
var filter = $(this).data('filter');
$blocks.isotope({
filter: filter,
percentPosition: true,
itemSelector: '.block',
columnWidth: '.block',
});
console.log('Filtered by', filter);
});

});
24 changes: 24 additions & 0 deletions www/wp-content/themes/ation2016/static/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,28 @@ jQuery( document ).ready( function( $ ) {
}
});

// Block grid
var $blocks = $('.blocks');

// Initialize isotope options
$blocks.isotope({ percentPosition: true, itemSelector: '.block', columnWidth: '.block' });

// Redo layout once each image is loaded
$blocks.imagesLoaded().progress( function() {
$blocks.isotope('layout');
});

// Filter grid items based on their work category, on the click of a filter
$('.work-bar a').click( function(e) {
e.preventDefault();
var filter = $(this).data('filter');
$blocks.isotope({
filter: filter,
percentPosition: true,
itemSelector: '.block',
columnWidth: '.block',
});
console.log('Filtered by', filter);
});

});
4 changes: 2 additions & 2 deletions www/wp-content/themes/ation2016/static/scripts/main.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ebbe4a3

Please sign in to comment.