Skip to content

Commit

Permalink
opts, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhellsing committed Oct 4, 2013
1 parent cc0caad commit e250ad6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/api/methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Manipulation

| returns **Galleria**
Loads new data into the gallery. The data should be structured the same way as JSON would be when first initialized
Loads new data into the gallery. The data should be structured as an Array and follow the same data patterns as the original JSON data

.splice( index, howMany[, element1[, ...[, elementN]]] )
--------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions docs/options/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ List of options

- :doc:`thumbnails` Sets how and if thumbnails should be created.

- :doc:`thumbPosition` Same as :doc:`imagePosition` for thumbnails.

- :doc:`thumbQuality` Defines if and how IE should use bicubic image rendering
for thumbnails

Expand Down
2 changes: 2 additions & 0 deletions docs/options/thumbFit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
thumbFit
========

**Note: this has been deprecated in 1.3**

| type: **Boolean**
| default: **true**
Expand Down
42 changes: 20 additions & 22 deletions src/galleria.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,6 @@ var window = this,
// clear styles
var clearStyle = function( elem ) {
setStyle( elem, 'none', 'transition' );
if ( Galleria.WEBKIT && Galleria.TOUCH ) {
setStyle( elem, 'translate3d(0,0,0)', 'transform' );
if ( elem.data('revert') ) {
elem.css( elem.data('revert') );
elem.data('revert', null);
}
}
};

// various variables
Expand Down Expand Up @@ -3513,12 +3506,12 @@ Galleria.prototype = {
config = config || o.dataConfig;

// if source is a true object, make it into an array
if( /^function Object/.test( source.constructor ) ) {
if( $.isPlainObject( source ) ) {
source = [source];
}

// check if the data is an array already
if ( source.constructor === Array ) {
if ( $.isArray( source ) ) {
if ( this.validate( source ) ) {
this._data = source;
} else {
Expand Down Expand Up @@ -5818,7 +5811,7 @@ Galleria.Picture.prototype = {
this.style.MozTransform = this.style.webkitTransform = 'translate3d(0,0,0)';
}

self.container.appendChild( this );
$container.append( this );

self.cache[ src ] = src; // will override old cache

Expand Down Expand Up @@ -6390,7 +6383,7 @@ Galleria.Finger = (function() {
// default options
this.config = {
start: 0,
duration: 240,
duration: 400,
onchange: function() {},
oncomplete: function() {},
easing: function(x,t,b,c,d) {
Expand Down Expand Up @@ -6472,6 +6465,11 @@ Galleria.Finger = (function() {
}
},

setPosition: function(pos) {
this.pos = pos;
this.to = pos;
},

ontouchstart: function(e) {

var touch = e.originalEvent.touches;
Expand Down Expand Up @@ -6558,18 +6556,18 @@ Galleria.Finger = (function() {

// if distance is short or the user is touching, do a 1-1 animation
if ( this.touching || abs(distance) <= 1 ) {
this.pos = this.to;
if ( this.anim ) {
this.config.oncomplete( this.index );
}
this.anim = 0;
this.pos = this.to;
if ( this.anim ) {
this.config.oncomplete( this.index );
}
this.anim = 0;
} else {
if ( !this.anim ) {
// save animation parameters
this.anim = { v: this.pos, c: distance, t: 0 };
}
// apply easing
this.pos = this.config.easing(null, this.anim.t++, this.anim.v, this.anim.c, (this.config.duration/10));
if ( !this.anim ) {
// save animation parameters
this.anim = { v: this.pos, c: distance, t: +new Date() };
}
// apply easing
this.pos = this.config.easing(null, +new Date() - this.anim.t, this.anim.v, this.anim.c, this.config.duration);
}
this.setX();
}
Expand Down

0 comments on commit e250ad6

Please sign in to comment.