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