Added translations for hints
Added toast exception for hide toast on click
This commit is contained in:
parent
8a3eded47a
commit
a0d23f5a39
File diff suppressed because one or more lines are too long
@ -7,10 +7,10 @@ const it = {
|
||||
by: 'di {0}',
|
||||
in: 'in {0}',
|
||||
download_hint: 'Scarica',
|
||||
play_hint: 'Play',
|
||||
toggle_download_tab_hint: 'Expand/Collapse',
|
||||
clean_queue_hint: 'Clear Finished',
|
||||
cancel_queue_hint: 'Cancel All',
|
||||
play_hint: 'Riproduci',
|
||||
toggle_download_tab_hint: 'Espandi/Riduci',
|
||||
clean_queue_hint: 'Pulisci Lista',
|
||||
cancel_queue_hint: 'Cancella tutti i download',
|
||||
listTabs: {
|
||||
all: 'tutto',
|
||||
top_result: 'miglior risultato',
|
||||
|
@ -18,6 +18,7 @@ export const toast = function(msg, icon = null, dismiss = true, id = null) {
|
||||
toastDOM.find('.toast-icon').html(icon)
|
||||
}
|
||||
if (dismiss !== null && dismiss) {
|
||||
toastDOM.addClass('dismissable')
|
||||
setTimeout(function() {
|
||||
toastObj.hideToast()
|
||||
delete toastsWithId[id]
|
||||
@ -32,8 +33,16 @@ export const toast = function(msg, icon = null, dismiss = true, id = null) {
|
||||
duration: dismiss ? 3000 : 0,
|
||||
gravity: 'bottom',
|
||||
position: 'left',
|
||||
className: dismiss ? 'dismissable' : '',
|
||||
onClick: function(){
|
||||
if (toastObj) {
|
||||
let dismissable = true
|
||||
if (id){
|
||||
let toastClasses = document.querySelector(`div.toastify[toast_id=${id}]`).classList
|
||||
if (toastClasses){
|
||||
dismissable = toastClasses.indexOf('dismissable') != -1
|
||||
}
|
||||
}
|
||||
if (toastObj && dismissable) {
|
||||
toastObj.hideToast()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user