-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuiElements.js
38 lines (35 loc) · 1.83 KB
/
uiElements.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// make the standard keyboard draggable and resizable. when it is dragged, let it snap to other elements. when it is resized, keep it proportional.
$("#stdKeyboard").draggable({snap: true}).resizable({aspectRatio: 750 / 250,
resize: function(event, ui) {
var keyHeight = parseInt($(this).children(".stdRow").css("height"));
$(".stdKey").css({"font-size": (keyHeight * 0.9 / 3) + "px"});
$(".stdKey").css({"line-height": (keyHeight * 0.9) + "px"});
$(".stdKey").children(".upper").css({"line-height": (keyHeight * 0.9 / 3 * 2) + "px"});
$(".stdKey").children(".lower").css({"line-height": (keyHeight * 0.9 / 3) + "px"});
}
});
// make the steno keyboard draggable and resizable. when it is dragged, let it snap to other elements. when it is resized, keep it proportional.
$("#stenoKeyboard").draggable({snap: true}).resizable({aspectRatio: 320 / 160,
resize: function(event, ui) {
var keyHeight = parseInt($(this).children(".stenoUpperBank").css("height"));
$(".stenoKey").css({"font-size": (keyHeight / 2) + "px"});
$(".stenoKey").css({"line-height": (keyHeight) + "px"});
}
});
// make the papers draggable and resizable. when it is dragged, let it snap to other elements.
$("#verticalNotesContainer").draggable({snap: true}).resizable({handles: 's',
alsoResize: "#outputContainer",
resize: function(event, ui) {
var containerHeight = parseInt($(this).css("height"));
$("#verticalNotes").css({"height": (containerHeight - 50) +"px"});
$("#output").css({"height": (containerHeight - 50) +"px"});
}
});
$("#outputContainer").draggable({snap: true}).resizable({handles: 's',
alsoResize: "#verticalNotesContainer",
resize: function(event, ui) {
var containerHeight = parseInt($(this).css("height"));
$("#verticalNotes").css({"height": (containerHeight - 50) +"px"});
$("#output").css({"height": (containerHeight - 50) +"px"});
}
});