From 8ff34aac4d060855ccff73681699f0e861284701 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 21 Sep 2013 12:16:48 -0700 Subject: [PATCH] Fixed series actions wrapping to two lines --- UI/Cells/SeriesActionsCell.js | 37 +++++++++++++++++++ .../Index/Table => Cells}/SeriesStatusCell.js | 0 UI/Cells/cells.less | 4 ++ UI/Series/Index/SeriesIndexLayout.js | 10 ++--- .../Index/Table/ControlsColumnTemplate.html | 2 - UI/Series/Index/Table/Row.js | 22 ----------- .../Index/Table/SeriesTitleTemplate.html | 1 - 7 files changed, 45 insertions(+), 31 deletions(-) create mode 100644 UI/Cells/SeriesActionsCell.js rename UI/{Series/Index/Table => Cells}/SeriesStatusCell.js (100%) delete mode 100644 UI/Series/Index/Table/ControlsColumnTemplate.html delete mode 100644 UI/Series/Index/Table/Row.js delete mode 100644 UI/Series/Index/Table/SeriesTitleTemplate.html diff --git a/UI/Cells/SeriesActionsCell.js b/UI/Cells/SeriesActionsCell.js new file mode 100644 index 000000000..84e90c688 --- /dev/null +++ b/UI/Cells/SeriesActionsCell.js @@ -0,0 +1,37 @@ +'use strict'; + +define( + [ + 'app', + 'Cells/NzbDroneCell' + ], function (App, NzbDroneCell) { + return NzbDroneCell.extend({ + + className: 'series-actions-cell', + + events: { + 'click .x-edit-series' : '_editSeries', + 'click .x-remove-series': '_removeSeries' + }, + + render: function () { + this.$el.empty(); + + this.$el.html( + ' ' + + '' + ); + + this.delegateEvents(); + return this; + }, + + _editSeries: function () { + App.vent.trigger(App.Commands.EditSeriesCommand, {series:this.model}); + }, + + _removeSeries: function () { + App.vent.trigger(App.Commands.DeleteSeriesCommand, {series:this.model}); + } + }); + }); diff --git a/UI/Series/Index/Table/SeriesStatusCell.js b/UI/Cells/SeriesStatusCell.js similarity index 100% rename from UI/Series/Index/Table/SeriesStatusCell.js rename to UI/Cells/SeriesStatusCell.js diff --git a/UI/Cells/cells.less b/UI/Cells/cells.less index 91e89f2b6..38789980c 100644 --- a/UI/Cells/cells.less +++ b/UI/Cells/cells.less @@ -87,4 +87,8 @@ td.episode-status-cell, td.quality-cell { color: rgb(255, 255, 255); background-color: rgb(0, 129, 194); } +} + +.series-actions-cell { + width: 40px; } \ No newline at end of file diff --git a/UI/Series/Index/SeriesIndexLayout.js b/UI/Series/Index/SeriesIndexLayout.js index 8b7a48c12..704e7f725 100644 --- a/UI/Series/Index/SeriesIndexLayout.js +++ b/UI/Series/Index/SeriesIndexLayout.js @@ -11,9 +11,9 @@ define( 'Cells/TemplatedCell', 'Cells/QualityProfileCell', 'Cells/EpisodeProgressCell', + 'Cells/SeriesActionsCell', 'Shared/Grid/DateHeaderCell', - 'Series/Index/Table/SeriesStatusCell', - 'Series/Index/Table/Row', + 'Cells/SeriesStatusCell', 'Series/Index/FooterView', 'Series/Index/FooterModel', 'Shared/Toolbar/ToolbarLayout' @@ -27,9 +27,9 @@ define( TemplatedCell, QualityProfileCell, EpisodeProgressCell, + SeriesActionsCell, DateHeaderCell, SeriesStatusCell, - SeriesIndexRow, FooterView, FooterModel, ToolbarLayout) { @@ -86,8 +86,7 @@ define( name : 'this', label : '', sortable: false, - template: 'Series/Index/Table/ControlsColumnTemplate', - cell : TemplatedCell + cell : SeriesActionsCell } ], @@ -124,7 +123,6 @@ define( _showTable: function () { this.currentView = new Backgrid.Grid({ - row : SeriesIndexRow, collection: SeriesCollection, columns : this.columns, className : 'table table-hover' diff --git a/UI/Series/Index/Table/ControlsColumnTemplate.html b/UI/Series/Index/Table/ControlsColumnTemplate.html deleted file mode 100644 index 042f6897e..000000000 --- a/UI/Series/Index/Table/ControlsColumnTemplate.html +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/UI/Series/Index/Table/Row.js b/UI/Series/Index/Table/Row.js deleted file mode 100644 index 4e17c21c1..000000000 --- a/UI/Series/Index/Table/Row.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; -define( - [ - 'app', - 'backgrid' - ], function (App, Backgrid) { - return Backgrid.Row.extend({ - events: { - 'click .x-edit' : 'editSeries', - 'click .x-remove': 'removeSeries' - }, - - editSeries: function () { - App.vent.trigger(App.Commands.EditSeriesCommand, {series:this.model}); - }, - - removeSeries: function () { - App.vent.trigger(App.Commands.DeleteSeriesCommand, {series:this.model}); - }, - }); - }); - diff --git a/UI/Series/Index/Table/SeriesTitleTemplate.html b/UI/Series/Index/Table/SeriesTitleTemplate.html deleted file mode 100644 index b4786d5b1..000000000 --- a/UI/Series/Index/Table/SeriesTitleTemplate.html +++ /dev/null @@ -1 +0,0 @@ -{{title}}