diff --git a/app/assets/javascripts/discourse/controllers/composer_controller.js b/app/assets/javascripts/discourse/controllers/composer_controller.js index 6b62f5bb670..16c0111676c 100644 --- a/app/assets/javascripts/discourse/controllers/composer_controller.js +++ b/app/assets/javascripts/discourse/controllers/composer_controller.js @@ -41,9 +41,9 @@ Discourse.ComposerController = Discourse.Controller.extend({ composer = this.get('content'); if( composer.get('cantSubmitPost') ) { - this.set('view.showTitleTip', true); - this.set('view.showCategoryTip', true); - this.set('view.showReplyTip', true); + this.set('view.showTitleTip', Date.now()); + this.set('view.showCategoryTip', Date.now()); + this.set('view.showReplyTip', Date.now()); return; } diff --git a/app/assets/javascripts/discourse/templates/composer.js.handlebars b/app/assets/javascripts/discourse/templates/composer.js.handlebars index d96650b23d8..551803f96f5 100644 --- a/app/assets/javascripts/discourse/templates/composer.js.handlebars +++ b/app/assets/javascripts/discourse/templates/composer.js.handlebars @@ -35,13 +35,13 @@
{{textField value=content.title tabindex="2" id="reply-title" maxlength="255" class="span8" placeholderKey="composer.title_placeholder"}} - {{popupInputTip validation=view.titleValidation show=view.showTitleTip}} + {{popupInputTip validation=view.titleValidation shownAt=view.showTitleTip}}
{{#unless content.creatingPrivateMessage}}
{{view Discourse.ComboboxViewCategory valueAttribute="name" contentBinding="categories" valueBinding="content.categoryName" showUncategorized="true"}} - {{popupInputTip validation=view.categoryValidation show=view.showCategoryTip}} + {{popupInputTip validation=view.categoryValidation shownAt=view.showCategoryTip}}
{{#if content.archetype.hasOptions}} @@ -61,7 +61,7 @@
{{view Discourse.NotifyingTextArea parentBinding="view" tabindex="3" valueBinding="content.reply" id="wmd-input" placeholderKey="composer.reply_placeholder"}} - {{popupInputTip validation=view.replyValidation show=view.showReplyTip}} + {{popupInputTip validation=view.replyValidation shownAt=view.showReplyTip}}
diff --git a/app/assets/javascripts/discourse/views/popup_input_tip_view.js b/app/assets/javascripts/discourse/views/popup_input_tip_view.js index 0b71b346f11..5247cd64069 100644 --- a/app/assets/javascripts/discourse/views/popup_input_tip_view.js +++ b/app/assets/javascripts/discourse/views/popup_input_tip_view.js @@ -12,7 +12,7 @@ **/ Discourse.PopupInputTipView = Discourse.View.extend({ templateName: 'popup_input_tip', - classNameBindings: [':popup-tip', 'good', 'bad', 'show::hide'], + classNameBindings: [':popup-tip', 'good', 'bad', 'shownAt::hide'], animateAttribute: null, bouncePixels: 6, bounceDelay: 100, @@ -26,20 +26,22 @@ Discourse.PopupInputTipView = Discourse.View.extend({ }.property('validation'), hide: function() { - this.set('show', false); + this.set('shownAt', false); }, bounce: function() { - var $elem = this.$() - if( !this.animateAttribute ) { - this.animateAttribute = $elem.css('left') === 'auto' ? 'right' : 'left'; + if( this.get('shownAt') ) { + var $elem = this.$() + if( !this.animateAttribute ) { + this.animateAttribute = $elem.css('left') === 'auto' ? 'right' : 'left'; + } + if( this.animateAttribute === 'left' ) { + this.bounceLeft($elem); + } else { + this.bounceRight($elem); + } } - if( this.animateAttribute === 'left' ) { - this.bounceLeft($elem); - } else { - this.bounceRight($elem); - } - }.observes('show'), + }.observes('shownAt'), bounceLeft: function($elem) { for( var i = 0; i < 5; i++ ) {