Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b94aacf
Added the new $.effects.piecer
Mar 24, 2011
4c2a597
Tried the piecer
Mar 24, 2011
cedf874
First split effect "build" created! need to checkup on the .hide func.
Mar 26, 2011
eee07da
Made some bugs so now build works propperly.
Mar 27, 2011
7f0daf3
Pinwheel is up!
Mar 27, 2011
61c75e2
test text updated!
Mar 28, 2011
9dd803a
testing
Mar 28, 2011
862208f
Rewriting so interval can be zero
Mar 28, 2011
e0b19cc
Indentation magic
Mar 28, 2011
771d193
Using the builtin effects.save/restore functions instead of
Mar 29, 2011
c541941
blockfade added and tested!
Mar 29, 2011
55da89c
Shear is on!
Mar 29, 2011
a3992d5
sexplode is inserted in one split file to unite all of em'
Mar 29, 2011
de4d7cc
Minor fixes added
Apr 1, 2011
5d792f3
Minor fixes
Apr 1, 2011
ee618d7
refixing defects
Apr 1, 2011
0e61cdb
Removed offset variable in $.effects.effect.build
Apr 1, 2011
de16a23
Removed last TODO's
Apr 1, 2011
19c4c89
Removed piecer from test
Apr 27, 2011
c9c21cd
changed the opt.show = 0 + (opt.mode == "show") to opt.show = opt.mode
Apr 27, 2011
d51e1f2
changed ' to " and used === instead of ==
Apr 27, 2011
d67e905
Dryed things around the setup of options
May 15, 2011
ab5a579
Added support so the animation won't go out side of the document size
May 15, 2011
15cc8f4
Removed the wrapper with document height/width!
May 16, 2011
a937f68
Removed direction from the effects not using it!
May 17, 2011
c07b28b
testing
May 18, 2011
7cd1157
Merge branch 'refs/heads/split' of https://lindstroem@github.com/lind…
May 18, 2011
66bc0fb
trailing comma removed
May 21, 2011
66c830d
Added complete to options list.
May 24, 2011
5c464cc
Minor changes
May 25, 2011
675b105
Merge branch 'master' of https://github.com/jquery/jquery-ui into
Jul 23, 2011
6039d3e
Changed so the effects uses the new DRY version of effects.core
Jul 23, 2011
928be4e
dummy change
Nov 9, 2011
f572598
Merge branch 'master' of https://github.com/jquery/jquery-ui into split
Nov 9, 2011
daaea85
Revert "dummy change"
Nov 9, 2011
6bd1a43
Trying to make reverting
Nov 9, 2011
34d956b
reverting
Nov 9, 2011
e698953
Reverting
Nov 9, 2011
57906d3
reverting
Nov 9, 2011
8756332
Revert goddammit!
Nov 9, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Using the builtin effects.save/restore functions instead of
hardcoding
  • Loading branch information
Jesper Lindstroem Nielsen authored and Jesper Lindstroem Nielsen committed Mar 29, 2011
commit 771d193c498492a2250bbd255a2f6f46e86e3dcf
32 changes: 11 additions & 21 deletions ui/jquery.effects.split.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,29 @@
var el = $( this ),
interval = o.interval,
duration = o.duration - ( o.rows + o.columns ) * interval,
pieceCounter = [],
pieceCounter = [],
documentCoords = {
height: $( document ).height(),
width: $( document ).width()
},
parentCoords = el.show().css('visibility','hidden').offset(),
container, pieces, i, j, properties;

parentCoords, container, pieces, i, j, properties;

$.effects.save( el, [ 'visibility', 'opacity' ] );

parentCoords = el.show().css('visibility','hidden').offset();
parentCoords.width = el.outerWidth();
parentCoords.height = el.outerHeight();

if (interval === false){
interval = o.duration / ( o.rows + o.columns * 2 );
}
console.log(interval);

//split into pieces
pieces = $.effects.piecer.call( this, o.rows, o.columns );
container = $( pieces[0] ).parent();

container.css('overflow', o.crop ? 'hidden' : 'visible');

// If element is to be hidden we make it invisible until the
// transformation is done and then hide it.
if ( !o.show ) {
el.css( 'visibility', 'hidden' );
}

//Make animation
for ( i = 0; i < o.rows; i++ ) {
for ( j = 0; j < o.columns; j++ ) {
Expand All @@ -77,16 +72,11 @@

function animComplete() {
// Ensures that the element is hidden/shown correctly
$.effects.restore( el, [ 'visibility', 'opacity' ] );
if ( o.show ) {
el.css( {
opacity: '',
visibility: ''
} ).show();
el.show();
} else {
el.css( {
opacity : '',
visibility : ''
} ).hide();
el.hide();
}
container.detach();
if ( $.isFunction( o.complete ) ) {
Expand Down Expand Up @@ -215,10 +205,10 @@
width = el.outerWidth(),
height = el.outerHeight(),
maxTop = documentCoords.height - height,
maxLeft = documentCoords.width - width,
maxLeft = documentCoords.width - width,
properties, top, left;

//TODO Porperties and offset can be collected in one object!
//TODO Porperties and offset can be collected in one object!, send width, height and offset into the function instead of calcing it.

offset = {
top : offset.top - parentCoords.top,
Expand Down