Toogle cell shows spinner when clicked

This commit is contained in:
Mark McDowall 2013-07-09 17:25:15 -07:00
parent 1143547556
commit b520554741
3 changed files with 17 additions and 6 deletions

View File

@ -14,11 +14,18 @@ define(
_onClick: function () { _onClick: function () {
var self = this;
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.render();
this.model.save(); this.$('i').addClass('icon-spinner icon-spin');
var promise = this.model.save();
promise.always(function (){
self.render();
});
}, },
render: function () { render: function () {

View File

@ -1,4 +1,4 @@
<div class="series-season"> <div class="series-season">
<h2>{{seasonTitle}} <i class="icon-search pull-right season-search x-season-search" /></h2> <h2>{{seasonTitle}} <span class="season-actions pull-right"><i class="icon-search x-season-search" /></span></h2>
<div id="x-episode-grid"/> <div id="x-episode-grid"/>
</div> </div>

View File

@ -172,11 +172,15 @@
.season-grid { .season-grid {
.toggle-cell { .toggle-cell {
width : 10px; width : 12px;
text-align: center;
} }
} }
.season-search { .season-actions {
.clickable;
font-size : 24px; font-size : 24px;
i {
.clickable;
}
} }