1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-26 01:37:07 +00:00

fixed toggle-cell tool-tips sticking around.

This commit is contained in:
Keivan Beigi 2013-07-25 19:09:17 -07:00
parent 642207c68d
commit 3f203acab9
6 changed files with 17 additions and 43 deletions

View file

@ -1,26 +0,0 @@
'use strict';
define(
[
'backgrid',
'moment',
'Shared/FormatHelpers'
], function (Backgrid, Moment, FormatHelpers) {
return Backgrid.Cell.extend({
className: 'air-date-cell',
render: function () {
this.$el.empty();
var date = this.model.get(this.column.get('name'));
if (date) {
this.$el.html('<div>' + FormatHelpers.DateHelper(date) + '</div>');
this.$el.children('div').attr('title', Moment(date).format('LLLL'));
}
return this;
}
});
});

View file

@ -14,8 +14,7 @@ define(
var date = this.model.get(this.column.get('name')); var date = this.model.get(this.column.get('name'));
if (date) { if (date) {
this.$el.html(FormatHelpers.DateHelper(date)); this.$el.html("<span title='" + Moment(date).format('LLLL') + "' >" + FormatHelpers.DateHelper(date) + "</span");
this.$el.attr('title', Moment(date).format('LLLL'));
} }
return this; return this;

View file

@ -14,16 +14,17 @@ define(
_onClick: function () { _onClick: function () {
var self = this; var self = this;
this.$el.tooltip('hide');
var name = this.column.get('name'); var name = this.column.get('name');
this.model.set(name, !this.model.get(name)); this.model.set(name, !this.model.get(name));
this.$('i').addClass('icon-spinner icon-spin'); this.$('i').addClass('icon-spinner icon-spin');
var promise = this.model.save(); this.model.save().always(function () {
promise.always(function (){
self.render(); self.render();
}); });
}, },
@ -44,7 +45,7 @@ define(
var tooltip = this.column.get('tooltip'); var tooltip = this.column.get('tooltip');
if (tooltip) { if (tooltip) {
this.$('i').attr('title', tooltip); this.$el.attr('title', tooltip);
} }
return this; return this;

View file

@ -7,10 +7,10 @@ define(
'Cells/SeriesTitleCell', 'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell', 'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell', 'Cells/EpisodeTitleCell',
'Cells/AirDateCell', 'Cells/RelativeDateCell',
'Shared/Grid/Pager', 'Shared/Grid/Pager',
'Shared/LoadingView' 'Shared/LoadingView'
], function (Marionette, Backgrid, MissingCollection, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, AirDateCell, GridPager, LoadingView) { ], function (Marionette, Backgrid, MissingCollection, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, RelativeDateCell, GridPager, LoadingView) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Missing/MissingLayoutTemplate', template: 'Missing/MissingLayoutTemplate',
@ -43,7 +43,7 @@ define(
{ {
name : 'airDateUtc', name : 'airDateUtc',
label: 'Air Date', label: 'Air Date',
cell : AirDateCell cell : RelativeDateCell
} }
], ],

View file

@ -5,11 +5,11 @@ define(
'backgrid', 'backgrid',
'Cells/ToggleCell', 'Cells/ToggleCell',
'Cells/EpisodeTitleCell', 'Cells/EpisodeTitleCell',
'Cells/AirDateCell', 'Cells/RelativeDateCell',
'Cells/EpisodeStatusCell', 'Cells/EpisodeStatusCell',
'Commands/CommandController', 'Commands/CommandController',
'Shared/Actioneer' 'Shared/Actioneer'
], function ( Marionette, Backgrid, ToggleCell, EpisodeTitleCell, AirDateCell, EpisodeStatusCell, CommandController, Actioneer) { ], function ( Marionette, Backgrid, ToggleCell, EpisodeTitleCell, RelativeDateCell, EpisodeStatusCell, CommandController, Actioneer) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Series/Details/SeasonLayoutTemplate', template: 'Series/Details/SeasonLayoutTemplate',
@ -56,7 +56,7 @@ define(
{ {
name : 'airDateUtc', name : 'airDateUtc',
label: 'Air Date', label: 'Air Date',
cell : AirDateCell cell : RelativeDateCell
} , } ,
{ {
name : 'status', name : 'status',

View file

@ -6,7 +6,7 @@ define(
'Series/Index/List/CollectionView', 'Series/Index/List/CollectionView',
'Series/Index/EmptyView', 'Series/Index/EmptyView',
'Series/SeriesCollection', 'Series/SeriesCollection',
'Cells/AirDateCell', 'Cells/RelativeDateCell',
'Cells/SeriesTitleCell', 'Cells/SeriesTitleCell',
'Cells/TemplatedCell', 'Cells/TemplatedCell',
'Cells/QualityProfileCell', 'Cells/QualityProfileCell',
@ -19,7 +19,7 @@ define(
ListCollectionView, ListCollectionView,
EmptyView, EmptyView,
SeriesCollection, SeriesCollection,
AirDateCell, RelativeDateCell,
SeriesTitleCell, SeriesTitleCell,
TemplatedCell, TemplatedCell,
QualityProfileCell, QualityProfileCell,
@ -66,7 +66,7 @@ define(
{ {
name : 'nextAiring', name : 'nextAiring',
label: 'Next Airing', label: 'Next Airing',
cell : AirDateCell cell : RelativeDateCell
}, },
{ {
name : 'this', name : 'this',