From 72cfde1303ed4b90fcd1406e5f4ee43b7392e7ff Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Fri, 7 Jun 2013 07:34:54 -0700 Subject: [PATCH] fixed FileSizeCell, template helper. --- UI/.idea/runConfigurations/Debug___Chrome.xml | 32 +++++++++---------- .../runConfigurations/Debug___Firefox.xml | 32 +++++++++---------- UI/Episode/Layout.js | 4 ++- UI/Shared/Cells/FileSizeCell.js | 3 +- UI/Shared/FormatHelpers.js | 5 ++- UI/Shared/Modal/Region.js | 5 ++- UI/Shared/TemplateHelpers.js | 2 +- 7 files changed, 44 insertions(+), 39 deletions(-) diff --git a/UI/.idea/runConfigurations/Debug___Chrome.xml b/UI/.idea/runConfigurations/Debug___Chrome.xml index 4ad681dfa..2323f096d 100644 --- a/UI/.idea/runConfigurations/Debug___Chrome.xml +++ b/UI/.idea/runConfigurations/Debug___Chrome.xml @@ -3,22 +3,22 @@ diff --git a/UI/.idea/runConfigurations/Debug___Firefox.xml b/UI/.idea/runConfigurations/Debug___Firefox.xml index 599880f12..1f0cbd78b 100644 --- a/UI/.idea/runConfigurations/Debug___Firefox.xml +++ b/UI/.idea/runConfigurations/Debug___Firefox.xml @@ -3,22 +3,22 @@ diff --git a/UI/Episode/Layout.js b/UI/Episode/Layout.js index e1864c633..cc4148794 100644 --- a/UI/Episode/Layout.js +++ b/UI/Episode/Layout.js @@ -67,7 +67,9 @@ define(['app', 'Shared/SpinnerView', 'Episode/Summary/View', 'Episode/Search/Lay var promise = releases.fetchEpisodeReleases(this.model.id); promise.done(function () { - self.search.show(new NzbDrone.Episode.Search.Layout({collection: releases})); + if (!self.isClosed) { + self.search.show(new NzbDrone.Episode.Search.Layout({collection: releases})); + } }); } diff --git a/UI/Shared/Cells/FileSizeCell.js b/UI/Shared/Cells/FileSizeCell.js index 5c071d37d..f1d8d4fab 100644 --- a/UI/Shared/Cells/FileSizeCell.js +++ b/UI/Shared/Cells/FileSizeCell.js @@ -5,7 +5,8 @@ NzbDrone.Shared.Cells.FileSizeCell = Backgrid.Cell.extend({ render: function () { var size = this.model.get(this.column.get("name")); + this.$el.html(NzbDrone.Shared.FormatHelpers.FileSizeHelper(size)); this.delegateEvents(); - return NzbDrone.Shared.FormatHelpers.FileSizeHelper(size); + return this; } }); diff --git a/UI/Shared/FormatHelpers.js b/UI/Shared/FormatHelpers.js index 23bd7415e..367077071 100644 --- a/UI/Shared/FormatHelpers.js +++ b/UI/Shared/FormatHelpers.js @@ -3,8 +3,7 @@ define(['app'], function () { NzbDrone.Shared.FormatHelpers.FileSizeHelper = function (sourceSize) { var size = Number(sourceSize); - this.$el.html(size.bytes(1)); - return this; + return size.bytes(1); }; NzbDrone.Shared.FormatHelpers.DateHelper = function (sourceDate) { @@ -33,4 +32,4 @@ define(['app'], function () { return date.format('{MM}/{dd}/{yyyy}'); }; -}); \ No newline at end of file +}); diff --git a/UI/Shared/Modal/Region.js b/UI/Shared/Modal/Region.js index 9b8ba1dc2..69cf4373d 100644 --- a/UI/Shared/Modal/Region.js +++ b/UI/Shared/Modal/Region.js @@ -21,7 +21,10 @@ define(function () { //need tab index so close on escape works //https://github.com/twitter/bootstrap/issues/4663 this.$el.attr('tabindex', '-1'); - this.$el.modal({'show': true, 'keyboard': true}); + this.$el.modal({ + 'show' : true, + 'keyboard': true, + 'backdrop': 'static'}); }, diff --git a/UI/Shared/TemplateHelpers.js b/UI/Shared/TemplateHelpers.js index 762777184..e6d8daeb0 100644 --- a/UI/Shared/TemplateHelpers.js +++ b/UI/Shared/TemplateHelpers.js @@ -21,7 +21,7 @@ define(['app'], function () { }); Handlebars.registerHelper("fileSize", function (size) { - return NzbDrone.Shared.FormatHelpers.FileSizeHelper(size); + return new Handlebars.SafeString(NzbDrone.Shared.FormatHelpers.FileSizeHelper(size)); }); Handlebars.registerHelper("date", function (date) {