function(cmd) { if (cmd !== 'remove') return; Dialog.prompt( 'Êtes vous sûr de vouloir supprimer ce produit?', { accept: this.triggerMethod.bind(this, 'remove'), acceptLabel: 'Oui', refuseLabel: 'Non' } ); return true; }
this.listenTo(this.listView, 'childview:remove', function(child_view, model) { Dialog.prompt( 'Êtes vous sûr de supprimer cette entrée ?', { accept: function() { model.destroy(); }, acceptLabel: 'Oui', refuseLabel: 'Non' } ); });
function(cmd) { if (cmd !== 'save') return; if (this.edited) { Dialog.prompt( 'Êtes vous sûr de vouloir sauvegarder les modificiations?', { accept: this.triggerMethod.bind(this, 'save'), acceptLabel: 'Oui', refuseLabel: 'Non' } ); return true; } },