[Events] Window injected with Angular

Used  provided by angular to better follow
style guidelines, as well as for utility in testing
later. #18.
This commit is contained in:
Sarah Hale 2015-06-23 15:40:12 -07:00
parent 5da210d350
commit 5d2afac83b
2 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@
{
"key": "mctDataTable",
"implementation": "directives/MCTDataTable.js",
"depends": [ "$anchorScroll" ]
"depends": [ "$window" ]
}
]
}

View File

@ -19,7 +19,7 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
/*global define,Promise*/
/*global define,Promise,window*/
/**
* Module defining MCTDataTable. Created by shale on 06/22/2015.
@ -29,7 +29,7 @@ define(
function () {
"use strict";
function MCTDataTable($anchorScroll) {
function MCTDataTable($window) {
return {
restrict: "E",
templateUrl: "platform/features/events/res/templates/mct-data-table.html",
@ -52,7 +52,7 @@ define(
$scope.$watch("rows", function () {
// Wait until the page as been repainted (otherwise the
// height will always be zero)
window.requestAnimationFrame(function () {
$window.requestAnimationFrame(function () {
previousHeight = currentHeight;
// The height of the table body
currentHeight = $element[0].firstElementChild.firstElementChild.nextElementSibling.clientHeight;