mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 07:58:34 +02:00
sliding in and out
This commit is contained in:
parent
e06a7efbfc
commit
b945037f34
5 changed files with 128 additions and 21 deletions
|
@ -64,6 +64,9 @@ var Visualization = Backbone.View.extend({
|
|||
if (!options.wait) {
|
||||
this.fadeTreeIn();
|
||||
}
|
||||
if (options.slideOut) {
|
||||
this.slideOut();
|
||||
}
|
||||
|
||||
this.customEvents.trigger('gitEngineReady');
|
||||
},
|
||||
|
@ -76,6 +79,28 @@ var Visualization = Backbone.View.extend({
|
|||
$(this.paper.canvas).css('opacity', 0);
|
||||
},
|
||||
|
||||
slideOut: function() {
|
||||
this.toggleSlide(true);
|
||||
},
|
||||
|
||||
slideIn: function() {
|
||||
this.toggleSlide(false);
|
||||
},
|
||||
|
||||
toggleSlide: function(value) {
|
||||
// no classes on svg :-/
|
||||
//$(this.paper.canvas).toggleClass('slideOut', value);
|
||||
var transform = (value) ? 'translate3d(-150%, 0, 0)' : 'translate3d(0,0,0)';
|
||||
|
||||
$(this.paper.canvas).css({
|
||||
'-webkit-transform': transform,
|
||||
'-moz-transform': transform,
|
||||
'-ms-transform': transform,
|
||||
'-o-transform': transform,
|
||||
'transform': transform
|
||||
});
|
||||
},
|
||||
|
||||
getAnimationTime: function() { return 300; },
|
||||
|
||||
fadeTreeIn: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue