Removed delete button from series lists, added refresh button

New: Refresh button on series lists (replaces delete)
New: Show series title on poster on hover
This commit is contained in:
Mark McDowall 2014-06-18 23:46:04 -07:00
parent 420e6ee533
commit 6c9ea60382
7 changed files with 106 additions and 55 deletions

View File

@ -3,25 +3,38 @@
define(
[
'vent',
'Cells/NzbDroneCell'
], function (vent, NzbDroneCell) {
'Cells/NzbDroneCell',
'Commands/CommandController'
], function (vent, NzbDroneCell, CommandController) {
return NzbDroneCell.extend({
className: 'series-actions-cell',
ui: {
refresh: '.x-refresh'
},
events: {
'click .x-edit-series' : '_editSeries',
'click .x-remove-series': '_removeSeries'
'click .x-edit' : '_editSeries',
'click .x-refresh' : '_refreshSeries'
},
render: function () {
this.$el.empty();
this.$el.html(
'<i class="icon-nd-edit x-edit-series" title="" data-original-title="Edit Series"></i> ' +
'<i class="icon-remove x-remove-series hidden-xs" title="" data-original-title="Delete Series"></i>'
'<i class="icon-refresh x-refresh hidden-xs" title="" data-original-title="Update series info and scan disk"></i> ' +
'<i class="icon-nd-edit x-edit" title="" data-original-title="Edit Series"></i>'
);
CommandController.bindToCommand({
element: this.$el.find('.x-refresh'),
command: {
name : 'refreshSeries',
seriesId : this.model.get('id')
}
});
this.delegateEvents();
return this;
},
@ -30,8 +43,11 @@ define(
vent.trigger(vent.Commands.EditSeriesCommand, {series:this.model});
},
_removeSeries: function () {
vent.trigger(vent.Commands.DeleteSeriesCommand, {series:this.model});
_refreshSeries: function () {
CommandController.Execute('refreshSeries', {
name : 'refreshSeries',
seriesId: this.model.id
});
}
});
});

View File

@ -3,26 +3,10 @@
define(
[
'vent',
'marionette'
], function (vent, Marionette) {
return Marionette.ItemView.extend({
'marionette',
'Series/Index/SeriesIndexItemView'
], function (vent, Marionette, SeriesIndexItemView) {
return SeriesIndexItemView.extend({
template: 'Series/Index/Overview/SeriesOverviewItemViewTemplate',
ui: {
'progressbar': '.progress .bar'
},
events: {
'click .x-edit' : 'editSeries',
'click .x-remove': 'removeSeries'
},
editSeries: function () {
vent.trigger(vent.Commands.EditSeriesCommand, {series: this.model});
},
removeSeries: function () {
vent.trigger(vent.Commands.DeleteSeriesCommand, {series: this.model});
}
});
});

View File

@ -14,8 +14,8 @@
</div>
<div class="col-md-2 col-xs-2">
<div class="pull-right series-overview-list-actions">
<i class="icon-refresh x-refresh" title="Update series info and scan disk"/>
<i class="icon-nd-edit x-edit" title="Edit Series"/>
<i class="icon-remove x-remove" title="Delete Series"/>
</div>
</div>
</div>

View File

@ -3,37 +3,25 @@
define(
[
'vent',
'marionette'
], function (vent, Marionette) {
'marionette',
'Series/Index/SeriesIndexItemView'
], function (vent, Marionette, SeriesIndexItemView) {
return Marionette.ItemView.extend({
return SeriesIndexItemView.extend({
tagName : 'li',
template: 'Series/Index/Posters/SeriesPostersItemViewTemplate',
initialize: function () {
this.events['mouseenter .x-series-poster'] = 'posterHoverAction';
this.events['mouseleave .x-series-poster'] = 'posterHoverAction';
ui: {
'progressbar': '.progress .bar',
'controls' : '.series-controls'
},
events: {
'click .x-edit' : 'editSeries',
'click .x-remove' : 'removeSeries',
'mouseenter .x-series-poster': 'posterHoverAction',
'mouseleave .x-series-poster': 'posterHoverAction'
},
editSeries: function () {
vent.trigger(vent.Commands.EditSeriesCommand, {series:this.model});
},
removeSeries: function () {
vent.trigger(vent.Commands.DeleteSeriesCommand, {series:this.model});
this.ui.controls = '.x-series-controls';
this.ui.title = '.x-title';
},
posterHoverAction: function () {
this.ui.controls.slideToggle();
this.ui.title.slideToggle();
}
});
});

View File

@ -1,9 +1,9 @@
<div class="series-posters-item">
<div class="center">
<div class="series-poster-container x-series-poster">
<div class="series-controls">
<div class="series-controls x-series-controls">
<i class="icon-refresh x-refresh" title="Refresh Series"/>
<i class="icon-nd-edit x-edit" title="Edit Series"/>
<i class="icon-remove x-remove" title="Delete Series"/>
</div>
{{#unless_eq status compare="continuing"}}
<div class="ended-banner">Ended</div>
@ -12,6 +12,9 @@
<img class="series-poster" src="{{poster}}" {{defaultImg}}>
<div class="center title">{{title}}</div>
</a>
<div class="hidden-title x-title">
{{title}}
</div>
</div>
</div>

View File

@ -0,0 +1,41 @@
'use strict';
define(
[
'vent',
'marionette',
'Commands/CommandController'
], function (vent, Marionette, CommandController) {
return Marionette.ItemView.extend({
ui: {
refresh : '.x-refresh'
},
events: {
'click .x-edit' : '_editSeries',
'click .x-refresh' : '_refreshSeries'
},
onRender: function () {
CommandController.bindToCommand({
element: this.ui.refresh,
command: {
name : 'refreshSeries',
seriesId : this.model.get('id')
}
});
},
_editSeries: function () {
vent.trigger(vent.Commands.EditSeriesCommand, {series: this.model});
},
_refreshSeries: function () {
CommandController.Execute('refreshSeries', {
name : 'refreshSeries',
seriesId: this.model.id
});
}
});
});

View File

@ -188,7 +188,22 @@
background-color : #eeeeee;
width : 100%;
text-align : right;
padding-right : 20px;
padding-right : 10px;
.opacity(0.8);
display : none;
i {
.clickable();
}
}
.hidden-title {
position : absolute;;
bottom : 0px;
overflow : hidden;
background-color : #eeeeee;
width : 100%;
text-align : center;
.opacity(0.8);
display : none;
}
@ -279,7 +294,7 @@
text-transform : none;
i {
.clickable;
.clickable();
font-size : 24px;
padding-left : 5px;
}
@ -340,6 +355,10 @@
.series-overview-list-actions {
min-width: 56px;
max-width: 56px;
i {
.clickable();
}
}
//Editor