notificationSoundsDisabled

This commit is contained in:
yuri
2016-05-05 13:03:15 +03:00
parent fe7684b46c
commit 7bd3dd26cf
5 changed files with 13 additions and 4 deletions
@@ -65,7 +65,8 @@
"dashboardLayout": "Dashboard Layout (default)",
"siteUrl": "Site URL",
"addressPreview": "Address Preview",
"addressFormat": "Address Format"
"addressFormat": "Address Format",
"notificationSoundsDisabled": "Disable Notification Sounds"
},
"options": {
"weekStart": {
@@ -2,7 +2,8 @@
{
"label": "In-app Notifications",
"rows": [
[{"name": "assignmentNotificationsEntityList"}]
[{"name": "assignmentNotificationsEntityList"}],
[{"name": "notificationSoundsDisabled"}]
]
},
{
@@ -304,6 +304,9 @@
"notStorable": true,
"readOnly": true,
"view": "views/settings/fields/address-preview"
},
"notificationSoundsDisabled": {
"type": "bool"
}
}
}
@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('Crm:Views.Meeting.PopupNotification', 'Views.PopupNotification', function (Dep) {
Espo.define('crm:crm:views/meeting/popup-notification', 'views/popup-notification', function (Dep) {
return Dep.extend({
@@ -34,7 +34,7 @@ Espo.define('Crm:Views.Meeting.PopupNotification', 'Views.PopupNotification', fu
style: 'primary',
template: 'crm:meeting.popup-notification',
template: 'crm:meeting/popup-notification',
closeButton: true,
+4
View File
@@ -44,6 +44,8 @@ Espo.define('views/popup-notification', 'view', function (Dep) {
var id = this.options.id;
var containerSelector = this.containerSelector = '#' + id;
this.notificationSoundsDisabled = this.getConfig().get('notificationSoundsDisabled');
this.on('render', function () {
$(containerSelector).remove();
@@ -85,6 +87,8 @@ Espo.define('views/popup-notification', 'view', function (Dep) {
},
playSound: function () {
if (this.notificationSoundsDisabled) return;
var html = '' +
'<audio autoplay="autoplay">'+
'<source src="' + this.soundPath + '.mp3" type="audio/mpeg" />'+