From aa9df49ea2b46ad208da279d4b0704a83f49f509 Mon Sep 17 00:00:00 2001
From: Mark McDowall <markus.mcd5@gmail.com>
Date: Tue, 3 Feb 2015 00:01:05 -0800
Subject: [PATCH] HeaderCell is a standard mixin

---
 src/UI/Shared/Grid/HeaderCell.js   | 6 +++++-
 src/UI/Shims/backgrid.js           | 5 +----
 src/UI/Shims/backgrid.paginator.js | 5 +----
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/UI/Shared/Grid/HeaderCell.js b/src/UI/Shared/Grid/HeaderCell.js
index 12fa6be20..1e821557b 100644
--- a/src/UI/Shared/Grid/HeaderCell.js
+++ b/src/UI/Shared/Grid/HeaderCell.js
@@ -1,4 +1,6 @@
-module.exports.register = function(backgrid) {
+module.exports = function() {
+    var backgrid = this;
+
     backgrid.SonarrHeaderCell = backgrid.HeaderCell.extend({
         events                  : {
             'click' : 'onClick'
@@ -109,4 +111,6 @@ module.exports.register = function(backgrid) {
             this.$el.children('i').removeClass('icon-sort-up icon-sort-down');
         }
     });
+
+    return backgrid.SonarrHeaderCell;
 };
diff --git a/src/UI/Shims/backgrid.js b/src/UI/Shims/backgrid.js
index 44c666a13..0292b5264 100644
--- a/src/UI/Shims/backgrid.js
+++ b/src/UI/Shims/backgrid.js
@@ -1,12 +1,9 @@
-require('../JsLibraries/backbone.backgrid');
-require('backbone');
-
 require('backbone');
 
 var backgrid = require('../JsLibraries/backbone.backgrid');
 var header = require('../Shared/Grid/HeaderCell');
 
-header.register(backgrid);
+header.call(backgrid);
 
 backgrid.Column.prototype.defaults = {
     name       : undefined,
diff --git a/src/UI/Shims/backgrid.paginator.js b/src/UI/Shims/backgrid.paginator.js
index 38bdf1c68..874fb4006 100644
--- a/src/UI/Shims/backgrid.paginator.js
+++ b/src/UI/Shims/backgrid.paginator.js
@@ -1,8 +1,5 @@
-require('backgrid');
-require('backbone');
-require('../JsLibraries/backbone.backgrid.paginator');
-
 require('backbone');
 var backgrid = require('backgrid');
 require('../JsLibraries/backbone.backgrid.paginator');
+
 module.exports = backgrid.Extension.Paginator;
\ No newline at end of file