BUGFIX: not showing tooltips correctly

This commit is contained in:
Sam 2014-06-05 10:55:45 +10:00
parent d07d53e339
commit 8ec9288a5c
2 changed files with 16 additions and 4 deletions

View file

@ -101,9 +101,9 @@ export default Discourse.Controller.extend({
if(composer.get('cantSubmitPost')) {
var now = Date.now();
this.setProperties({
"view.showTitleTip": now,
"view.showCategoryTip": now,
"view.showReplyTip": now
'view.showTitleTip': now,
'view.showCategoryTip': now,
'view.showReplyTip': now
});
return;
}

View file

@ -404,12 +404,24 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, {
// I hate to use Em.run.later, but I don't think there's a way of waiting for a CSS transition
// to finish.
return Em.run.later(jQuery, (function() {
Em.run.later(jQuery, (function() {
var replyTitle = $('#reply-title');
self.resize();
self.refreshPreview();
return replyTitle.length ? replyTitle.putCursorAtEnd() : $wmdInput.putCursorAtEnd();
}), 300);
$('#reply-title').on('focusout', function(){
self.set('showTitleTip', Date.now());
});
$('#wmd-input').on('focusout', function(){
self.set('showReplyTip', Date.now());
});
self.$('.category-input').on('focusout', function(){
self.set('showCategoryTip', Date.now());
});
},
addMarkdown: function(text) {