[Common UI] Expose mct-scroll-x, mct-scroll-y

Expose mct-scroll-x and mct-scroll-y directives. WTD-920.
This commit is contained in:
Victor Woeltjen 2015-02-25 16:05:57 -08:00
parent f8b352c4d8
commit 9a88e5172a
2 changed files with 33 additions and 1 deletions

View File

@ -105,6 +105,34 @@
"key": "mctResize",
"implementation": "directives/MCTResize.js",
"depends": [ "$timeout" ]
},
{
"key": "mctScrollX",
"implementations": "directives/MCTScroll.js",
"depends": [ "$parse", "MCT_SCROLL_X_PROPERTY", "MCT_SCROLL_X_ATTRIBUTE" ]
},
{
"key": "mctScrollY",
"implementations": "directives/MCTScroll.js",
"depends": [ "$parse", "MCT_SCROLL_Y_PROPERTY", "MCT_SCROLL_Y_ATTRIBUTE" ]
}
],
"constants": [
{
"key": "MCT_SCROLL_X_PROPERTY",
"value": "scrollLeft"
},
{
"key": "MCT_SCROLL_X_ATTRIBUTE",
"value": "mctScrollX"
},
{
"key": "MCT_SCROLL_Y_PROPERTY",
"value": "scrollTop"
},
{
"key": "MCT_SCROLL_Y_ATTRIBUTE",
"value": "mctScrollY"
}
],
"containers": [

View File

@ -6,12 +6,16 @@ define(
'use strict';
/**
* Superclass of mct-scroll-x and mct-scroll-y directives. Listens
* Implements `mct-scroll-x` and `mct-scroll-y` directives. Listens
* for scroll events and publishes their results into scope; watches
* scope and updates scroll state to match. This varies for x- and y-
* directives only by the attribute name chosen to find the expression,
* and the property (scrollLeft or scrollTop) managed within the
* element.
*
* This is exposed as two directives in `bundle.json`; the difference
* is handled purely by parameterization.
*
* @constructor
* @param $parse Angular's $parse
* @param {string} property property to manage within the HTML element