channel.js (nsq-1.2.0) | : | channel.js (nsq-1.2.1) | ||
---|---|---|---|---|
skipping to change at line 46 | skipping to change at line 46 | |||
e.stopPropagation(); | e.stopPropagation(); | |||
var action = $(e.currentTarget).data('action'); | var action = $(e.currentTarget).data('action'); | |||
var txt = 'Are you sure you want to <strong>' + | var txt = 'Are you sure you want to <strong>' + | |||
action + '</strong> <em>' + this.model.get('topic') + | action + '</strong> <em>' + this.model.get('topic') + | |||
'/' + this.model.get('name') + '</em>?'; | '/' + this.model.get('name') + '</em>?'; | |||
bootbox.confirm(txt, function(result) { | bootbox.confirm(txt, function(result) { | |||
if (result !== true) { | if (result !== true) { | |||
return; | return; | |||
} | } | |||
if (action === 'delete') { | if (action === 'delete') { | |||
var topic = this.model.get('topic'); | ||||
$.ajax(this.model.url(), {'method': 'DELETE'}) | $.ajax(this.model.url(), {'method': 'DELETE'}) | |||
.done(function() { | .done(function() { | |||
window.location = AppState.basePath('/topics/' + | window.location = AppState.basePath('/topics/' + | |||
encodeURIComponent(this.model.get('topic'))); | encodeURIComponent(topic)); | |||
}) | }) | |||
.fail(this.handleAJAXError.bind(this)); | .fail(this.handleAJAXError.bind(this)); | |||
} else { | } else { | |||
$.post(this.model.url(), JSON.stringify({'action': action})) | $.post(this.model.url(), JSON.stringify({'action': action})) | |||
.done(function() { window.location.reload(true); }) | .done(function() { window.location.reload(true); }) | |||
.fail(this.handleAJAXError.bind(this)); | .fail(this.handleAJAXError.bind(this)); | |||
} | } | |||
}.bind(this)); | }.bind(this)); | |||
} | } | |||
}); | }); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added |