From cf71b742bceccf46ab9872c3d7ea091263cf9c56 Mon Sep 17 00:00:00 2001 From: Salvatore Iovene Date: Wed, 3 Oct 2012 10:42:39 +0300 Subject: [PATCH] [Calf] Implements page transitions. --- example/index.html | 1 + example/javascripts/app/views/albums.js | 2 +- example/javascripts/app/views/artists.js | 2 +- example/javascripts/app/views/page.js | 13 +++++++++++++ example/javascripts/app/views/songs.js | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 example/javascripts/app/views/page.js diff --git a/example/index.html b/example/index.html index 9b13c1f..3a095d4 100644 --- a/example/index.html +++ b/example/index.html @@ -106,6 +106,7 @@ + diff --git a/example/javascripts/app/views/albums.js b/example/javascripts/app/views/albums.js index 36da417..723d5b6 100644 --- a/example/javascripts/app/views/albums.js +++ b/example/javascripts/app/views/albums.js @@ -1,7 +1,7 @@ (function(app, Ember) { 'use strict'; - var AlbumsView = Ember.View.extend({ + var AlbumsView = app.Page.extend({ templateName: 'albums', tagName: 'ul', classNames: ['item-list', 'striped'] diff --git a/example/javascripts/app/views/artists.js b/example/javascripts/app/views/artists.js index 01dd3d4..ea47119 100644 --- a/example/javascripts/app/views/artists.js +++ b/example/javascripts/app/views/artists.js @@ -1,7 +1,7 @@ (function(app, Ember) { 'use strict'; - var ArtistsView = Ember.View.extend({ + var ArtistsView = app.Page.extend({ templateName: 'artists', tagName: 'ul', classNames: ['item-list', 'striped'] diff --git a/example/javascripts/app/views/page.js b/example/javascripts/app/views/page.js new file mode 100644 index 0000000..c31dc90 --- /dev/null +++ b/example/javascripts/app/views/page.js @@ -0,0 +1,13 @@ +(function(app, Ember) { + 'use strict'; + + var Page = Ember.View.extend({ + didInsertElement: function() { + this.$() + .css({opacity: 0}) + .animate({opacity: 1}, 250); + } + }); + + app.Page = Page; +})(window.Calf, window.Ember); \ No newline at end of file diff --git a/example/javascripts/app/views/songs.js b/example/javascripts/app/views/songs.js index 18df3c9..e8654f1 100644 --- a/example/javascripts/app/views/songs.js +++ b/example/javascripts/app/views/songs.js @@ -1,7 +1,7 @@ (function(app, Ember) { 'use strict'; - var SongsView = Ember.View.extend({ + var SongsView = app.Page.extend({ templateName: 'songs', tagName: 'ul', classNames: ['item-list', 'striped'] -- 2.7.4