From b520554741474b798f4e58e95b73b020d569ebb1 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 9 Jul 2013 17:25:15 -0700 Subject: [PATCH] Toogle cell shows spinner when clicked --- UI/Cells/ToggleCell.js | 11 +++++++++-- UI/Series/Details/SeasonLayoutTemplate.html | 2 +- UI/Series/series.less | 10 +++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/UI/Cells/ToggleCell.js b/UI/Cells/ToggleCell.js index f0337aa82..812dc79d5 100644 --- a/UI/Cells/ToggleCell.js +++ b/UI/Cells/ToggleCell.js @@ -14,11 +14,18 @@ define( _onClick: function () { + var self = this; + var name = this.column.get('name'); this.model.set(name, !this.model.get(name)); - this.render(); - this.model.save(); + this.$('i').addClass('icon-spinner icon-spin'); + + var promise = this.model.save(); + + promise.always(function (){ + self.render(); + }); }, render: function () { diff --git a/UI/Series/Details/SeasonLayoutTemplate.html b/UI/Series/Details/SeasonLayoutTemplate.html index 4522cc268..c4b59fe00 100644 --- a/UI/Series/Details/SeasonLayoutTemplate.html +++ b/UI/Series/Details/SeasonLayoutTemplate.html @@ -1,4 +1,4 @@ 
-

{{seasonTitle}}

+

{{seasonTitle}}

diff --git a/UI/Series/series.less b/UI/Series/series.less index 07bc836bd..ffd78f75c 100644 --- a/UI/Series/series.less +++ b/UI/Series/series.less @@ -172,11 +172,15 @@ .season-grid { .toggle-cell { - width : 10px; + width : 12px; + text-align: center; } } -.season-search { - .clickable; +.season-actions { font-size : 24px; + + i { + .clickable; + } }