Skip to content

Commit

Permalink
RocketChat#734 Изменения ответов | Переработано меню popover в сообще…
Browse files Browse the repository at this point in the history
…ниях
  • Loading branch information
Scarvis committed Oct 8, 2020
1 parent 0454a58 commit 5f24259
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/errand/client/createErrandMessageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Meteor.startup(function() {

return uid !== u._id ? hasPermission('start-errand-other-user') : hasPermission('start-errand');
},
order: 1,
order: 2,
group: 'menu',
});
});
Expand Down
2 changes: 1 addition & 1 deletion app/reactions/client/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Meteor.startup(function() {

return true;
},
order: -2,
order: 3,
group: ['message', 'menu'],
});
});
2 changes: 1 addition & 1 deletion app/tags/client/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Meteor.startup(function() {

return true;
},
order: -3,
order: 2,
group: ['message', 'menu'],
});
});
Expand Down
2 changes: 1 addition & 1 deletion app/ui-utils/client/lib/MessageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Meteor.startup(async function() {

return true;
},
order: 3,
order: 1,
group: 'menu',
});

Expand Down
30 changes: 16 additions & 14 deletions app/ui-utils/client/lib/popover.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ <h3 class="rc-popover__title">{{group.title}}</h3>
<ul class="rc-popover__list">
{{#each item in group.items}}
{{# with item}}
<li class="rc-popover__item {{#if item.modifier}}rc-popover__item--{{item.modifier}}{{/if}}{{#if hasAction}} js-action{{/if}}" data-type={{item.type}} data-id={{item.id.toLowerCase}} data-href={{item.href}} data-sidenav={{item.sideNav}}>
{{#if item.icon}}
<span class="rc-popover__icon">
{{> icon block="rc-popover__icon-element" icon=item.icon }}
</span>
{{#if check_item_name item}}
<li class="rc-popover__item {{#if item.modifier}}rc-popover__item--{{item.modifier}}{{/if}}{{#if hasAction}} js-action{{/if}}" data-type={{item.type}} data-id={{item.id.toLowerCase}} data-href={{item.href}} data-sidenav={{item.sideNav}}>
{{#if item.icon}}
<span class="rc-popover__icon">
{{> icon block="rc-popover__icon-element" icon=item.icon }}
</span>
{{/if}}
{{#if item.name}}
<span class="rc-popover__item-text">{{item.name}}</span>
{{/if}}
{{#if item.select}}
<span class="rc-popover__input">
{{> selectDropdown title=item.selectTitle name=item.selectName options=item.selectOptions}}
</span>
{{/if}}
</li>
{{/if}}
{{#if item.name}}
<span class="rc-popover__item-text">{{item.name}}</span>
{{/if}}
{{#if item.select}}
<span class="rc-popover__input">
{{> selectDropdown title=item.selectTitle name=item.selectName options=item.selectOptions}}
</span>
{{/if}}
</li>
{{/with}}
{{/each}}
</ul>
Expand Down
19 changes: 19 additions & 0 deletions app/ui-utils/client/lib/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,23 @@ Template.popover.events({

Template.popover.helpers({
isSafariIos: /iP(ad|hone|od).+Version\/[\d\.]+.*Safari/i.test(navigator.userAgent),
check_item_name(item) {
if (!item.id) {
return false;
}

if (item.id === 'reply-in-thread') {
return false;
}
if (item.id === 'start-discussion') {
return false;
}
if (item.id === 'follow-message') {
return false;
}
if (item.id === 'jump-to-pin-message') {
return false;
}
return true;
},
});

0 comments on commit 5f24259

Please sign in to comment.