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')) { if(composer.get('cantSubmitPost')) {
var now = Date.now(); var now = Date.now();
this.setProperties({ this.setProperties({
"view.showTitleTip": now, 'view.showTitleTip': now,
"view.showCategoryTip": now, 'view.showCategoryTip': now,
"view.showReplyTip": now 'view.showReplyTip': now
}); });
return; 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 // I hate to use Em.run.later, but I don't think there's a way of waiting for a CSS transition
// to finish. // to finish.
return Em.run.later(jQuery, (function() { Em.run.later(jQuery, (function() {
var replyTitle = $('#reply-title'); var replyTitle = $('#reply-title');
self.resize(); self.resize();
self.refreshPreview(); self.refreshPreview();
return replyTitle.length ? replyTitle.putCursorAtEnd() : $wmdInput.putCursorAtEnd(); return replyTitle.length ? replyTitle.putCursorAtEnd() : $wmdInput.putCursorAtEnd();
}), 300); }), 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) { addMarkdown: function(text) {