[Common UI] Tweak mct-split-pane

Tweak mct-split-pane for use in timeline; particularly,
improve synchronization between views. WTD-1363.
This commit is contained in:
Victor Woeltjen
2015-06-27 11:59:18 -07:00
parent a0d5a1a196
commit 8c5b497377
2 changed files with 22 additions and 19 deletions

View File

@@ -47,20 +47,23 @@ define(
element.addClass("splitter");
// Now that we have the above class, the splitter width
// will have changed, so trigger a positioning update.
mctSplitPane.position(mctSplitPane.position());
scope.splitter = {
// Begin moving this splitter
startMove: function () {
var splitter = element[0];
initialPosition = splitter[OFFSETS_BY_EDGE[
mctSplitPane.anchor().edge
]];
initialPosition = mctSplitPane.position();
},
// Handle user changes to splitter position
move: function (delta) {
var anchor = mctSplitPane.anchor(),
pixelDelta = delta[
anchor.orientation === "vertical" ? 0 : 1
];
index = anchor.orientation === "vertical" ? 0 : 1,
pixelDelta = delta[index] *
(anchor.reversed ? -1 : 1);
// Update the position of this splitter
mctSplitPane.position(initialPosition + pixelDelta);
}