-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] set-toolbar-items postMessage #11109
Changes from 3 commits
2c3ea15
cbbd888
ca95772
bfe6116
5d46063
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,25 +104,38 @@ Template.header.helpers({ | |
}); | ||
|
||
Template.header.events({ | ||
'click .iframe-toolbar button'() { | ||
'click .iframe-toolbar .js-iframe-action'(e) { | ||
fireGlobalEvent('click-toolbar-button', { id: this.id }); | ||
$('button', e.currentTarget).blur(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
return false; | ||
}, | ||
|
||
'click .rc-header__toggle-favorite'(event) { | ||
event.stopPropagation(); | ||
event.preventDefault(); | ||
return Meteor.call('toggleFavorite', this._id, !$(event.currentTarget).hasClass('favorite-room'), function(err) { | ||
if (err) { | ||
return handleError(err); | ||
return Meteor.call( | ||
'toggleFavorite', | ||
this._id, | ||
!$(event.currentTarget).hasClass('favorite-room'), | ||
function(err) { | ||
if (err) { | ||
return handleError(err); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you avoid some extra lines using an arrow function? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes we can! |
||
} | ||
}); | ||
); | ||
}, | ||
|
||
'click .edit-room-title'(event) { | ||
event.preventDefault(); | ||
Session.set('editRoomTitle', true); | ||
$('.rc-header').addClass('visible'); | ||
return Meteor.setTimeout(() => $('#room-title-field').focus().select(), 10); | ||
return Meteor.setTimeout( | ||
() => | ||
$('#room-title-field') | ||
.focus() | ||
.select(), | ||
10 | ||
); | ||
} | ||
}); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe compact mapper function as