mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
UI Cleanup - Updated Activity subtree.
This commit is contained in:
@@ -1,68 +1,67 @@
|
||||
'use strict';
|
||||
|
||||
define(
|
||||
[
|
||||
'jquery',
|
||||
'marionette',
|
||||
'Cells/TemplatedCell',
|
||||
'Activity/Queue/RemoveFromQueueView',
|
||||
'vent'
|
||||
], function ($, Marionette, TemplatedCell, RemoveFromQueueView, vent) {
|
||||
return TemplatedCell.extend({
|
||||
var $ = require('jquery');
|
||||
var vent = require('../../vent');
|
||||
var Marionette = require('marionette');
|
||||
var TemplatedCell = require('../../Cells/TemplatedCell');
|
||||
var RemoveFromQueueView = require('./RemoveFromQueueView');
|
||||
|
||||
template : 'Activity/Queue/QueueActionsCellTemplate',
|
||||
className : 'queue-actions-cell',
|
||||
module.exports = TemplatedCell.extend({
|
||||
|
||||
events: {
|
||||
'click .x-remove' : '_remove',
|
||||
'click .x-import' : '_import',
|
||||
'click .x-grab' : '_grab'
|
||||
},
|
||||
template : 'Activity/Queue/QueueActionsCellTemplate',
|
||||
className : 'queue-actions-cell',
|
||||
|
||||
ui: {
|
||||
import : '.x-import',
|
||||
grab : '.x-grab'
|
||||
},
|
||||
events : {
|
||||
'click .x-remove' : '_remove',
|
||||
'click .x-import' : '_import',
|
||||
'click .x-grab' : '_grab'
|
||||
},
|
||||
|
||||
_remove : function () {
|
||||
ui : {
|
||||
import : '.x-import',
|
||||
grab : '.x-grab'
|
||||
},
|
||||
|
||||
var showBlacklist = this.model.get('status') !== 'Pending';
|
||||
_remove : function() {
|
||||
var showBlacklist = this.model.get('status') !== 'Pending';
|
||||
|
||||
vent.trigger(vent.Commands.OpenModalCommand, new RemoveFromQueueView({ model: this.model, showBlacklist: showBlacklist }));
|
||||
},
|
||||
vent.trigger(vent.Commands.OpenModalCommand, new RemoveFromQueueView({
|
||||
model : this.model,
|
||||
showBlacklist : showBlacklist
|
||||
}));
|
||||
},
|
||||
|
||||
_import : function () {
|
||||
var self = this;
|
||||
_import : function() {
|
||||
var self = this;
|
||||
|
||||
var promise = $.ajax({
|
||||
url: window.NzbDrone.ApiRoot + '/queue/import',
|
||||
type: 'POST',
|
||||
data: JSON.stringify(this.model.toJSON())
|
||||
});
|
||||
|
||||
$(this.ui.import).spinForPromise(promise);
|
||||
|
||||
promise.success(function () {
|
||||
//find models that have the same series id and episode ids and remove them
|
||||
self.model.trigger('destroy', self.model);
|
||||
});
|
||||
},
|
||||
|
||||
_grab : function () {
|
||||
var self = this;
|
||||
|
||||
var promise = $.ajax({
|
||||
url: window.NzbDrone.ApiRoot + '/queue/grab',
|
||||
type: 'POST',
|
||||
data: JSON.stringify(this.model.toJSON())
|
||||
});
|
||||
|
||||
$(this.ui.grab).spinForPromise(promise);
|
||||
|
||||
promise.success(function () {
|
||||
//find models that have the same series id and episode ids and remove them
|
||||
self.model.trigger('destroy', self.model);
|
||||
});
|
||||
}
|
||||
var promise = $.ajax({
|
||||
url : window.NzbDrone.ApiRoot + '/queue/import',
|
||||
type : 'POST',
|
||||
data : JSON.stringify(this.model.toJSON())
|
||||
});
|
||||
});
|
||||
|
||||
$(this.ui.import).spinForPromise(promise);
|
||||
|
||||
promise.success(function() {
|
||||
//find models that have the same series id and episode ids and remove them
|
||||
self.model.trigger('destroy', self.model);
|
||||
});
|
||||
},
|
||||
|
||||
_grab : function() {
|
||||
var self = this;
|
||||
|
||||
var promise = $.ajax({
|
||||
url : window.NzbDrone.ApiRoot + '/queue/grab',
|
||||
type : 'POST',
|
||||
data : JSON.stringify(this.model.toJSON())
|
||||
});
|
||||
|
||||
$(this.ui.grab).spinForPromise(promise);
|
||||
|
||||
promise.success(function() {
|
||||
//find models that have the same series id and episode ids and remove them
|
||||
self.model.trigger('destroy', self.model);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user