From dad67d06418cd26748feac6f7e490555a446a8f9 Mon Sep 17 00:00:00 2001 From: Adrian Pardini Date: Fri, 5 Apr 2013 09:47:20 -0300 Subject: [PATCH] Medialist use 'self' instead of '_this' --- public/js/views/medialist.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/js/views/medialist.js b/public/js/views/medialist.js index ffda970..5c6d158 100644 --- a/public/js/views/medialist.js +++ b/public/js/views/medialist.js @@ -57,16 +57,16 @@ window.MediaListView2 = function(options){ var MediaListViewModel = kb.ViewModel.extend({ constructor: function(model) { kb.ViewModel.prototype.constructor.apply(this, arguments); - var _this = this; + var self = this; this.editingName = ko.observable(false); this.nameClick = function () { this.editingName(true); } this.changeFocus = function () { - if(_this.name().length<=0) + if(self.name().length<=0) return false; - _this.editingName(false); + self.editingName(false); } this.filter = ko.observable(''); @@ -74,7 +74,7 @@ window.MediaListView2 = function(options){ view_model: kb.ViewModel, filters: function(model) { var filter; - filter = _this.filter(); + filter = self.filter(); if (!filter) return false; var re = new RegExp(filter,"i"); return ( model.get('file').search(re) < 0 && @@ -85,7 +85,7 @@ window.MediaListView2 = function(options){ this.total_time = ko.computed(function(){ //XXX: keep this, it tells KO to update total_time when something happens to the collection - var x = _this.collection(); + var x = self.collection(); return model.pretty_duration(); }, model);