[Code Style] Use prototypes in About bundle

WTD-1482.
This commit is contained in:
Victor Woeltjen
2015-08-10 10:19:02 -07:00
parent 0b9b936368
commit 78146d97f8
3 changed files with 41 additions and 43 deletions

View File

@ -41,30 +41,28 @@ define(
* @param $window Angular-injected window object * @param $window Angular-injected window object
*/ */
function AboutController(versions, $window) { function AboutController(versions, $window) {
return { this.versionDefinitions = versions;
this.$window = $window;
}
/** /**
* Get version info. This is given as an array of * Get version info. This is given as an array of
* objects, where each object is intended to appear * objects, where each object is intended to appear
* as a line-item in the version information listing. * as a line-item in the version information listing.
* @memberof AboutController#
* @returns {object[]} version information * @returns {object[]} version information
* @memberof platform/commonUI/about.AboutController#
*/ */
versions: function () { AboutController.prototype.versions = function () {
return versions; return this.versionDefinitions;
}, };
/** /**
* Open a new window (or tab, depending on browser * Open a new window (or tab, depending on browser
* configuration) containing open source licenses. * configuration) containing open source licenses.
* @memberof AboutController#
* @memberof platform/commonUI/about.AboutController#
*/ */
openLicenses: function () { AboutController.prototype.openLicenses = function () {
// Open a new browser window at the licenses route // Open a new browser window at the licenses route
$window.open("#/licenses"); this.$window.open("#/licenses");
}
}; };
}
return AboutController; return AboutController;
} }

View File

@ -33,17 +33,17 @@ define(
* @constructor * @constructor
*/ */
function LicenseController(licenses) { function LicenseController(licenses) {
return { this.licenseDefinitions = licenses;
}
/** /**
* Get license information. * Get license information.
* @returns {Array} license extensions * @returns {Array} license extensions
* @memberof platform/commonUI/about.LicenseController# * @memberof platform/commonUI/about.LicenseController#
*/ */
licenses: function () { LicenseController.prototype.licenses = function () {
return licenses; return this.licenseDefinitions;
}
}; };
}
return LicenseController; return LicenseController;
} }

View File

@ -34,17 +34,17 @@ define(
* @param {OverlayService} overlayService the overlay service * @param {OverlayService} overlayService the overlay service
*/ */
function LogoController(overlayService) { function LogoController(overlayService) {
return { this.overlayService = overlayService;
}
/** /**
* Display the About dialog. * Display the About dialog.
* @memberof LogoController# * @memberof LogoController#
* @memberof platform/commonUI/about.LogoController# * @memberof platform/commonUI/about.LogoController#
*/ */
showAboutDialog: function () { LogoController.prototype.showAboutDialog = function () {
overlayService.createOverlay("overlay-about"); this.overlayService.createOverlay("overlay-about");
}
}; };
}
return LogoController; return LogoController;
} }