Skip to content

Commit

Permalink
v0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsroge committed Jun 27, 2015
1 parent 1cb3b1a commit d49dca3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "owl.carousel2.thumbs",
"version": "0.1.3",
"version": "0.1.4",
"homepage": "https://github.com/gijsroge/OwlCarousel2-Thumbs",
"authors": [
{ "name" : "Gijs Rogé",
Expand Down
20 changes: 12 additions & 8 deletions dist/owl.carousel2.thumbs.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*! owl.carousel2.thumbs - v0.1.2 | (c) 2015 @gijsroge | MIT license | https://github.com/gijsroge/OwlCarousel2-Thumbs */
/*! owl.carousel2.thumbs - v0.1.4 | (c) 2015 @gijsroge | MIT license | https://github.com/gijsroge/OwlCarousel2-Thumbs */
/**
* Thumbs Plugin
* @version 2.0.0
* @author Gijs Rogé
* @author Gijs Rogé
* @license The MIT License (MIT)
*/
(function ($, window, document, undefined) {
Expand Down Expand Up @@ -62,7 +62,7 @@
*/
this._handlers = {
'prepared.owl.carousel': $.proxy(function (e) {
if (e.namespace && this.owl.options.thumbs && !this.owl.options.thumbImage && !this.owl.options.thumbPrerendered && !this.owl.options.thumbImage) {
if (e.namespace && this.owl.options.thumbs && !this.owl.options.thumbImage && !this.owl.options.thumbsPrerendered && !this.owl.options.thumbImage) {
if ($(e.content).find('[data-thumb]').attr('data-thumb') !== undefined) {
this._thumbcontent.push($(e.content).find('[data-thumb]').attr('data-thumb'));
}
Expand Down Expand Up @@ -105,7 +105,8 @@
thumbs: true,
thumbImage: false,
thumbContainerClass: 'owl-thumbs',
thumbItemClass: 'owl-thumb-item'
thumbItemClass: 'owl-thumb-item',
moveThumbsInside: false
};


Expand All @@ -118,7 +119,7 @@
//set default options
var options = this.owl.options;

if (options.thumbPrerendered) {
if (options.thumbsPrerendered) {
this._thumbcontent._thumbcontainer = $('.' + options.thumbContainerClass);
}

Expand All @@ -131,7 +132,7 @@
// get index of clicked thumbnail
var index = $(e.target).parent().is(this._thumbcontent._thumbcontainer) ? $(e.target).index() : $(e.target).parent().index();

if (options.thumbPrerendered) {
if (options.thumbsPrerendered) {
// slide to slide :)
$('[data-slider-id=' + this._identifier + ']').trigger('to.owl.carousel', index);
} else {
Expand All @@ -156,7 +157,10 @@
if (!options.thumbsPrerendered) {
this._thumbcontent._thumbcontainer = $('<div>').addClass(options.thumbContainerClass).appendTo(this.$element);
} else {
this._thumbcontent._thumbcontainer = $('.' + options.thumbContainerClass + '').appendTo(this.$element);
this._thumbcontent._thumbcontainer = $('.' + options.thumbContainerClass + '');
if(options.moveThumbsInside){
this._thumbcontent._thumbcontainer.appendTo(this.$element);
}
}

//create thumb items
Expand Down Expand Up @@ -189,7 +193,7 @@
var options = this.owl.options;

// set relative thumbnail container
var thumbContainer = options.thumbPrerendered ? $('.' + options.thumbContainerClass + '[data-slider-id="' + this._identifier + '"]') : this._thumbcontent._thumbcontainer;
var thumbContainer = options.thumbsPrerendered ? $('.' + options.thumbContainerClass + '[data-slider-id="' + this._identifier + '"]') : this._thumbcontent._thumbcontainer;
thumbContainer.children().filter('.active').removeClass('active');
thumbContainer.children().eq(this.owl_currentitem).addClass('active');
};
Expand Down
4 changes: 2 additions & 2 deletions dist/owl.carousel2.thumbs.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "owl.carousel2.thumbs",
"title": "Owl Carousel 2 Thumbnails",
"description": "Enables thumbnail support for Owl Carousel 2.0",
"version": "0.1.3",
"version": "0.1.4",
"main": "dist/owl.carousel2.thumbs.min.js",
"homepage": "https://github.com/gijsroge/OwlCarousel2-Thumbs",
"author": {
Expand Down

0 comments on commit d49dca3

Please sign in to comment.