From 78146d97f8b81a41b4a99d28f353bde24ae25010 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Mon, 10 Aug 2015 10:19:02 -0700 Subject: [PATCH] [Code Style] Use prototypes in About bundle WTD-1482. --- .../commonUI/about/src/AboutController.js | 44 +++++++++---------- .../commonUI/about/src/LicenseController.js | 20 ++++----- platform/commonUI/about/src/LogoController.js | 20 ++++----- 3 files changed, 41 insertions(+), 43 deletions(-) diff --git a/platform/commonUI/about/src/AboutController.js b/platform/commonUI/about/src/AboutController.js index c40df7e824..dffd9b9471 100644 --- a/platform/commonUI/about/src/AboutController.js +++ b/platform/commonUI/about/src/AboutController.js @@ -41,31 +41,29 @@ define( * @param $window Angular-injected window object */ function AboutController(versions, $window) { - return { - /** - * Get version info. This is given as an array of - * objects, where each object is intended to appear - * as a line-item in the version information listing. - * @memberof AboutController# - * @returns {object[]} version information - * @memberof platform/commonUI/about.AboutController# - */ - versions: function () { - return versions; - }, - /** - * Open a new window (or tab, depending on browser - * configuration) containing open source licenses. - * @memberof AboutController# - * @memberof platform/commonUI/about.AboutController# - */ - openLicenses: function () { - // Open a new browser window at the licenses route - $window.open("#/licenses"); - } - }; + this.versionDefinitions = versions; + this.$window = $window; } + /** + * Get version info. This is given as an array of + * objects, where each object is intended to appear + * as a line-item in the version information listing. + * @returns {object[]} version information + */ + AboutController.prototype.versions = function () { + return this.versionDefinitions; + }; + + /** + * Open a new window (or tab, depending on browser + * configuration) containing open source licenses. + */ + AboutController.prototype.openLicenses = function () { + // Open a new browser window at the licenses route + this.$window.open("#/licenses"); + }; + return AboutController; } ); diff --git a/platform/commonUI/about/src/LicenseController.js b/platform/commonUI/about/src/LicenseController.js index a2e7463b37..740124641f 100644 --- a/platform/commonUI/about/src/LicenseController.js +++ b/platform/commonUI/about/src/LicenseController.js @@ -33,18 +33,18 @@ define( * @constructor */ function LicenseController(licenses) { - return { - /** - * Get license information. - * @returns {Array} license extensions - * @memberof platform/commonUI/about.LicenseController# - */ - licenses: function () { - return licenses; - } - }; + this.licenseDefinitions = licenses; } + /** + * Get license information. + * @returns {Array} license extensions + * @memberof platform/commonUI/about.LicenseController# + */ + LicenseController.prototype.licenses = function () { + return this.licenseDefinitions; + }; + return LicenseController; } ); diff --git a/platform/commonUI/about/src/LogoController.js b/platform/commonUI/about/src/LogoController.js index f151900df5..85909a0552 100644 --- a/platform/commonUI/about/src/LogoController.js +++ b/platform/commonUI/about/src/LogoController.js @@ -34,18 +34,18 @@ define( * @param {OverlayService} overlayService the overlay service */ function LogoController(overlayService) { - return { - /** - * Display the About dialog. - * @memberof LogoController# - * @memberof platform/commonUI/about.LogoController# - */ - showAboutDialog: function () { - overlayService.createOverlay("overlay-about"); - } - }; + this.overlayService = overlayService; } + /** + * Display the About dialog. + * @memberof LogoController# + * @memberof platform/commonUI/about.LogoController# + */ + LogoController.prototype.showAboutDialog = function () { + this.overlayService.createOverlay("overlay-about"); + }; + return LogoController; } );