diff --git a/app/assets/javascripts/app/models/stream.js b/app/assets/javascripts/app/models/stream.js index d48086f54..a466b2d87 100644 --- a/app/assets/javascripts/app/models/stream.js +++ b/app/assets/javascripts/app/models/stream.js @@ -72,6 +72,9 @@ app.models.Stream = Backbone.Collection.extend({ var preloadJson = window.preLoadContent && JSON.parse(window.preLoadContent) delete window.preLoadContent // always do this just to be safe in preventing dirty state across navigates - if(preloadJson) { this.items.reset(preloadJson) } + if(preloadJson) { + this.items.reset(preloadJson) + this.trigger("fetched") + } } }); diff --git a/app/assets/javascripts/app/pages/profile.js b/app/assets/javascripts/app/pages/profile.js index 3d4f11b7f..b73bcdf2c 100644 --- a/app/assets/javascripts/app/pages/profile.js +++ b/app/assets/javascripts/app/pages/profile.js @@ -36,6 +36,11 @@ app.pages.Profile = app.views.Base.extend({ this.model = new app.models.Profile.findByGuid(options.personId) this.stream = options && options.stream || new app.models.Stream() + + /* binds for getting started pulsation */ + this.stream.bind("fetched", this.pulsateNewPostControl, this) + this.stream.items.bind("remove", this.pulsateNewPostControl, this) + this.stream.preloadOrFetch(); this.canvasView = new app.views.Canvas({ model : this.stream }) @@ -44,6 +49,14 @@ app.pages.Profile = app.views.Base.extend({ this.profileInfo = new app.views.ProfileInfo({ model : this.model.set({isOwnProfile : this.isOwnProfile()}) }) }, + pulsateNewPostControl : function() { + this.$("#composer-button")[ + this.stream.items.length == 0 + ? 'addClass' + : 'removeClass' + ]("pulse") + }, + toggleEdit : function(evt) { if(evt) { evt.preventDefault() } this.editMode = !this.editMode diff --git a/app/assets/stylesheets/new-templates.css.scss b/app/assets/stylesheets/new-templates.css.scss index 793a0af3e..16155d4ff 100644 --- a/app/assets/stylesheets/new-templates.css.scss +++ b/app/assets/stylesheets/new-templates.css.scss @@ -1,6 +1,10 @@ @import 'mixins'; +@import 'new_styles/new_mixins'; @import 'new_styles/variables'; +/* custom animations */ +@import 'new_styles/animations'; + /* mainly for the post viewer & composer */ @import 'new_styles/base'; @import 'new_styles/composer'; diff --git a/app/assets/stylesheets/new_styles/_animations.scss b/app/assets/stylesheets/new_styles/_animations.scss new file mode 100644 index 000000000..b02bb8da6 --- /dev/null +++ b/app/assets/stylesheets/new_styles/_animations.scss @@ -0,0 +1,15 @@ +@-webkit-keyframes opacity-pulse { + 0% { @include opacity(0.3); } + 65% { @include opacity(0.9); } + 100% { @include opacity(0.3); } +} +@-moz-keyframes opacity-pulse { + 0% { @include opacity(0.3); } + 65% { @include opacity(0.9); } + 100% { @include opacity(0.3); } +} +@-ms-keyframes opacity-pulse { + 0% { @include opacity(0.3); } + 65% { @include opacity(0.9); } + 100% { @include opacity(0.3); } +} \ No newline at end of file diff --git a/app/assets/stylesheets/new_styles/_base.scss b/app/assets/stylesheets/new_styles/_base.scss index 8f57082de..fe2cf1a9b 100644 --- a/app/assets/stylesheets/new_styles/_base.scss +++ b/app/assets/stylesheets/new_styles/_base.scss @@ -1,5 +1,3 @@ -@import "_new_mixins"; - /* new link color */ a { color : rgb(42,156,235) } diff --git a/app/assets/stylesheets/new_styles/_profile.scss b/app/assets/stylesheets/new_styles/_profile.scss index 856e61c7e..300326ab9 100644 --- a/app/assets/stylesheets/new_styles/_profile.scss +++ b/app/assets/stylesheets/new_styles/_profile.scss @@ -1,3 +1,10 @@ +/* getting started pulse animation */ +#composer-button.pulse { + -webkit-animation: opacity-pulse 1s infinite; + -moz-animation: opacity-pulse 1s infinite; + -ms-animation: opacity-pulse 1s infinite; +} + /* functionality under edit mode */ .edit-mode { #edit-mode-toggle.control { diff --git a/app/assets/templates/profile.jst.hbs b/app/assets/templates/profile.jst.hbs index 55538e53e..ebc58f3bb 100644 --- a/app/assets/templates/profile.jst.hbs +++ b/app/assets/templates/profile.jst.hbs @@ -46,7 +46,7 @@
{{#if isOwnProfile}} - +