UX: add notification level button to mobile

This commit is contained in:
Sam Saffron
2016-12-08 17:47:34 +11:00
parent b9b4b0c175
commit b4cafc5e78
4 changed files with 29 additions and 7 deletions

View File

@@ -52,8 +52,16 @@ export default Ember.Component.extend({
_expanded() {
if (this.get('info.topicProgressExpanded')) {
$(window).on('click.hide-fullscreen', (e) => {
if ( $(e.target).is('.topic-timeline') ||
!$(e.target).parents().is('#topic-progress-wrapper')) {
let $target = $(e.target);
let $parents = $target.parents();
if ( !$target.is('.widget-button') &&
!$parents.is('.widget-button') &&
!$parents.is('.dropdown-menu') &&
(
$target.is('.topic-timeline') ||
!$parents.is('#topic-progress-wrapper')
)
) {
this._collapseFullscreen();
}
});

View File

@@ -12,7 +12,7 @@ createWidget('notification-option', {
h('span.icon', { className: `fa fa-${attrs.icon} ${attrs.key}`}),
h('div', [
h('span.title', I18n.t(`topic.notifications.${attrs.key}.title`)),
h('span', I18n.t(`topic.notifications.${attrs.key}.description`)),
h('span.desc', I18n.t(`topic.notifications.${attrs.key}.description`)),
])
]);
},

View File

@@ -334,9 +334,6 @@ export default createWidget('topic-timeline', {
}));
}
if (currentUser) {
controls.push(this.attach('topic-notifications-button', { topic }));
}
}
if (attrs.fullScreen) {
@@ -348,6 +345,10 @@ export default createWidget('topic-timeline', {
}));
}
if (currentUser) {
controls.push(this.attach('topic-notifications-button', { topic }));
}
if (controls.length > 0) {
result.push(h('div.timeline-footer-controls', controls));
}