[Browse] Begin implementing splitter movement
Begin implementing moveable splitter, WTD-747.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
function SplitPaneController() {
|
||||
var minimum = 8,
|
||||
maximum = 600,
|
||||
current = 200,
|
||||
style;
|
||||
|
||||
function updateStyle() {
|
||||
style = { left: current + 'px' };
|
||||
}
|
||||
|
||||
updateStyle();
|
||||
|
||||
return {
|
||||
style: function () {
|
||||
return style;
|
||||
},
|
||||
move: function (delta) {
|
||||
current = Math.min(
|
||||
maximum,
|
||||
Math.max(minimum, current + delta)
|
||||
);
|
||||
updateStyle();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return SplitPaneController;
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user