Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Commit

Permalink
cleaning comments, removing unneeded spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
addyosmani committed Nov 12, 2010
1 parent d0a2b29 commit 92f040b
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions ui.coverflow.js
@@ -1,8 +1,7 @@
/* /*
* jQuery UI CoverFlow * jQuery UI CoverFlow
Original Component: Paul Bakaus Re-written for jQueryUI 1.8.6 by Addy Osmani with adjustments
Minor changes to appear more 'coverflow-like' in cooperation Original Component: Paul Bakaus for jQueryUI 1.7 series
with front-end UI extension in app.js - Addy Osmani.
*/ */
(function($){ (function($){


Expand All @@ -23,8 +22,8 @@
orientation: 'horizontal', orientation: 'horizontal',
item: 0, item: 0,
trigger: 'click', trigger: 'click',
center: true, //If set to false, the actual element's base position isn't touched in any way center: true, //If false, element's base position isn't touched in any way
recenter: true //If set to false, the parent element's position doesn't get animated while items change recenter: true //If false, the parent element's position doesn't get animated while items change


}, },


Expand All @@ -33,24 +32,17 @@
var self = this, o = this.options; var self = this, o = this.options;
this.items = $(o.items, this.element); this.items = $(o.items, this.element);
this.props = o.orientation == 'vertical' ? ['height', 'Height', 'top', 'Top'] : ['width', 'Width', 'left', 'Left']; this.props = o.orientation == 'vertical' ? ['height', 'Height', 'top', 'Top'] : ['width', 'Width', 'left', 'Left'];
//this.itemSize = this.items.innerWidth(); //190, //1.8.6: this.items['outer'+this.props[1]](1); //For < 1.8.2: this.items['outer'+this.props[1]](1);



this.itemSize = 0.73 * this.items.innerWidth(); this.itemSize = 0.73 * this.items.innerWidth();

console.log(this.items.innerHeight());
console.log(this.items.outerHeight());


this.itemWidth = this.items.width(); this.itemWidth = this.items.width();
this.itemHeight = this.items.height(); this.itemHeight = this.items.height();
this.duration = o.duration; this.duration = o.duration;
this.current = o.item; //Start item this.current = o.item; //initial item









//Bind click events on individual items //Bind click events on individual items
this.items.bind(o.trigger, function() { this.items.bind(o.trigger, function() {
self.select(this); self.select(this);
Expand All @@ -59,10 +51,7 @@




//Center the actual parent's left side within it's parent //Center the actual parent's left side within it's parent





this.element.css(this.props[2], this.element.css(this.props[2],
(o.recenter ? -this.current * this.itemSize/2 : 0) (o.recenter ? -this.current * this.itemSize/2 : 0)
+ (o.center ? this.element.parent()[0]['offset'+this.props[1]]/2 - this.itemSize/2 : 0) //Center the items container + (o.center ? this.element.parent()[0]['offset'+this.props[1]]/2 - this.itemSize/2 : 0) //Center the items container
Expand Down Expand Up @@ -94,8 +83,7 @@
// 2. Animate the parent's left/top property so the current item is in the center // 2. Animate the parent's left/top property so the current item is in the center
// 3. Use our custom coverflow animation which animates the item // 3. Use our custom coverflow animation which animates the item







var animation = { coverflow: 1 }; var animation = { coverflow: 1 };


Expand All @@ -107,10 +95,6 @@
); );










//Trigger the 'select' event/callback //Trigger the 'select' event/callback
if(!noPropagation) this._trigger('select', null, this._uiHash()); if(!noPropagation) this._trigger('select', null, this._uiHash());
Expand Down Expand Up @@ -156,7 +140,6 @@









$(this).css(css); $(this).css(css);


Expand Down

0 comments on commit 92f040b

Please sign in to comment.