@ -1,5 +1,5 @@
/ *
/ *
TimelineJS - ver . 2.35 . 5 - 2015 - 02 - 26
TimelineJS - ver . 2015 - 03 - 25 - 15 - 07 - 0 5 - 2015 - 03 - 25
Copyright ( c ) 2012 - 2013 Northwestern University
Copyright ( c ) 2012 - 2013 Northwestern University
a project of the Northwestern University Knight Lab , originally created by Zach Wise
a project of the Northwestern University Knight Lab , originally created by Zach Wise
https : //github.com/NUKnightLab/TimelineJS
https : //github.com/NUKnightLab/TimelineJS
@ -668,20 +668,21 @@ if(typeof VMM != 'undefined') {
} ,
} ,
prop : function ( element , aName , value ) {
prop : function ( element , aName , value ) {
if ( typeof jQuery == 'undefined' || ! ( 'prop' in jQuery . fn ) ) {
if ( typeof jQuery == 'undefined' || ! /[1-9]\.[3-9].[1-9]/ . test ( jQuery . fn . jquery ) ) {
return VMM . Lib . attribute ( element , aName , value ) ;
VMM . Lib . attribute ( element , aName , value ) ;
} else if ( typeof value != 'undefined' ) {
return jQuery ( element ) . prop ( aName , value ) ;
} else {
} else {
return jQuery ( element ) . prop ( aName ) ;
jQuery ( element ) . prop ( aName , value ) ;
}
}
} ,
} ,
attribute : function ( element , aName , value ) {
attribute : function ( element , aName , value ) {
if ( typeof ( jQuery ) != 'undefined' ) {
if ( typeof ( value ) != 'undefined' && value != null && value != "" ) {
if ( value != null && value != "" ) {
return jQuery ( element ) . attr ( aName , value ) ;
if ( typeof ( jQuery ) != 'undefined' ) {
} else {
jQuery ( element ) . attr ( aName , value ) ;
}
} else {
if ( typeof ( jQuery ) != 'undefined' ) {
return jQuery ( element ) . attr ( aName ) ;
return jQuery ( element ) . attr ( aName ) ;
}
}
}
}
@ -813,9 +814,8 @@ if(typeof VMM != 'undefined') {
}
}
} ,
} ,
// TODO: Consider removing this as it's referenced by one commented line
delay _animate : function ( delay , element , duration , ease , att , callback _function ) {
delay _animate : function ( delay , element , duration , ease , att , callback _function ) {
if ( VMM . Browser . features . css . transitions && ! ( 'scrollTop' in _att ) ) {
if ( VMM . Browser . device == "mobile" || VMM . Browser . device == "tablet" ) {
var _tdd = Math . round ( ( duration / 1500 ) * 10 ) / 10 ,
var _tdd = Math . round ( ( duration / 1500 ) * 10 ) / 10 ,
_ _duration = _tdd + 's' ;
_ _duration = _tdd + 's' ;
@ -838,7 +838,7 @@ if(typeof VMM != 'undefined') {
var _ease = "easein" ,
var _ease = "easein" ,
_que = false ,
_que = false ,
_duration = 1000 ,
_duration = 1000 ,
_att ;
_att = { } ;
if ( duration != null ) {
if ( duration != null ) {
if ( duration < 1 ) {
if ( duration < 1 ) {
@ -859,18 +859,20 @@ if(typeof VMM != 'undefined') {
if ( att != null ) {
if ( att != null ) {
_att = att ;
_att = att
} else {
} else {
_att = { opacity : 0 } ;
_att = { opacity : 0 }
}
}
if ( VMM . Browser . features . css . transitions && ! ( 'scrollTop' in _att ) ) {
if ( VMM . Browser . device == "mobile" || VMM . Browser . device == "tablet" ) {
var _tdd = Math . round ( ( _duration / 1500 ) * 10 ) / 10 ,
var _tdd = Math . round ( ( _duration / 1500 ) * 10 ) / 10 ,
_ _duration = _tdd + 's' ;
_ _duration = _tdd + 's' ;
_ease = " cubic-bezier(0.33, 0.66, 0.66, 1)" ;
_ease = " cubic-bezier(0.33, 0.66, 0.66, 1)" ;
//_ease = " ease-in-out";
//_ease = " ease-in-out";
for ( var x in _att ) {
for ( x in _att ) {
if ( Object . prototype . hasOwnProperty . call ( _att , x ) ) {
if ( Object . prototype . hasOwnProperty . call ( _att , x ) ) {
trace ( x + " to " + _att [ x ] ) ;
trace ( x + " to " + _att [ x ] ) ;
VMM . Lib . css ( element , '-webkit-transition' , x + ' ' + _ _duration + _ease ) ;
VMM . Lib . css ( element , '-webkit-transition' , x + ' ' + _ _duration + _ease ) ;
@ -1002,11 +1004,6 @@ if(typeof VMM != 'undefined' && typeof VMM.Browser == 'undefined') {
this . OS = this . searchString ( this . dataOS ) || "an unknown OS" ;
this . OS = this . searchString ( this . dataOS ) || "an unknown OS" ;
this . device = this . searchDevice ( navigator . userAgent ) ;
this . device = this . searchDevice ( navigator . userAgent ) ;
this . orientation = this . searchOrientation ( window . orientation ) ;
this . orientation = this . searchOrientation ( window . orientation ) ;
this . features = {
css : {
transitions : this . cssTransitionSupport ( )
}
} ;
} ,
} ,
searchOrientation : function ( orientation ) {
searchOrientation : function ( orientation ) {
var orient = "" ;
var orient = "" ;
@ -1150,30 +1147,9 @@ if(typeof VMM != 'undefined' && typeof VMM.Browser == 'undefined') {
subString : "Linux" ,
subString : "Linux" ,
identity : "Linux"
identity : "Linux"
}
}
] ,
]
cssTransitionSupport : function ( ) {
// See https://gist.github.com/jackfuchs/556448
var b = document . body || document . documentElement ,
s = b . style ,
p = 'transition' ;
if ( typeof s [ p ] == 'string' ) {
return true ;
}
// Tests for vendor specific prop
var v = [ 'Moz' , 'webkit' , 'Webkit' , 'Khtml' , 'O' , 'ms' ] ;
p = p . charAt ( 0 ) . toUpperCase ( ) + p . substr ( 1 ) ;
for ( var i = 0 ; i < v . length ; i ++ ) {
if ( typeof s [ v [ i ] + p ] == 'string' ) {
return true ;
}
}
return false ;
}
}
} ;
VMM . Browser . init ( ) ;
VMM . Browser . init ( ) ;
}
}
@ -5793,8 +5769,6 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
} else {
} else {
VMM . Lib . css ( layout , "overflow-y" , "hidden" ) ;
VMM . Lib . css ( layout , "overflow-y" , "hidden" ) ;
var scroll _height = 0 ;
var scroll _height = 0 ;
// FIXME: Chrome cannot optimize this try/catch block, which appears to be unnecessary – see https://github.com/NUKnightLab/TimelineJS/pull/681#issuecomment-52365420
try {
try {
scroll _height = VMM . Lib . prop ( layout , "scrollHeight" ) ;
scroll _height = VMM . Lib . prop ( layout , "scrollHeight" ) ;
VMM . Lib . animate ( layout , _duration , _ease , { scrollTop : scroll _height - VMM . Lib . height ( layout ) } ) ;
VMM . Lib . animate ( layout , _duration , _ease , { scrollTop : scroll _height - VMM . Lib . height ( layout ) } ) ;