@@ -32,46 +32,50 @@ var App = angular.module("openshot-timeline", ["ui.bootstrap", "ngAnimate"]);
32
32
33
33
34
34
// Wait for document ready event
35
- $ ( document ) . ready ( function ( ) {
35
+ $ ( document ) . ready ( function ( ) {
36
+
37
+ var body_object = $ ( "body" ) ;
36
38
37
39
/// Capture window resize event, and resize scrollable divs (i.e. track container)
38
- $ ( window ) . resize ( function ( ) {
40
+ $ ( window ) . resize ( function ( ) {
39
41
40
42
// Determine Y offset for track container div
41
- var track_offset = $ ( "#track_controls" ) . offset ( ) . top ;
43
+ var track_controls = $ ( "#track_controls" ) ;
44
+ var track_offset = track_controls . offset ( ) . top ;
42
45
43
46
// Set the height of the scrollable divs. This resizes the tracks to fit the remaining
44
47
// height of the web page. As the user changes the size of the web page, this will continue
45
48
// to fire, and resize the child divs to fit.
46
49
var new_track_height = $ ( this ) . height ( ) - track_offset ;
47
50
48
- $ ( "# track_controls" ) . height ( new_track_height ) ;
51
+ track_controls . height ( new_track_height ) ;
49
52
$ ( "#scrolling_tracks" ) . height ( new_track_height ) ;
50
- $ ( "body" ) . scope ( ) . playhead_height = $ ( "#track-container" ) . height ( ) ;
51
- $ ( ".playhead-line" ) . height ( $ ( "body" ) . scope ( ) . playhead_height ) ;
53
+ body_object . scope ( ) . playhead_height = $ ( "#track-container" ) . height ( ) ;
54
+ $ ( ".playhead-line" ) . height ( body_object . scope ( ) . playhead_height ) ;
52
55
} ) ;
53
56
54
57
// Check for Qt Integration
55
- if ( typeof timeline !== "undefined" ) {
58
+ if ( typeof timeline !== "undefined" ) {
56
59
timeline . qt_log ( "Qt Found!" ) ;
57
- $ ( "body" ) . scope ( ) . EnableQt ( ) ;
60
+ body_object . scope ( ) . EnableQt ( ) ;
58
61
timeline . page_ready ( ) ;
59
- $ ( "body" ) . scope ( ) . SetThumbAddress ( timeline . get_thumb_address ( ) ) ;
62
+ body_object . scope ( ) . SetThumbAddress ( timeline . get_thumb_address ( ) ) ;
60
63
}
61
64
62
65
// Manually trigger the window resize code (to verify it runs at least once)
63
66
$ ( window ) . trigger ( "resize" ) ;
64
67
65
68
// Bind to keydown event (to detect SHIFT)
66
- $ ( "body" ) . keydown ( function ( event ) {
69
+ body_object . keydown ( function ( event ) {
67
70
if ( event . which === 16 ) {
68
- $ ( "body" ) . scope ( ) . shift_pressed = true ;
71
+ body_object . scope ( ) . shift_pressed = true ;
69
72
}
70
73
} ) ;
71
- $ ( "body" ) . keyup ( function ( event ) {
72
- if ( $ ( "body" ) . scope ( ) . shift_pressed ) {
73
- $ ( "body" ) . scope ( ) . shift_pressed = false ;
74
+
75
+ body_object . keyup ( function ( ) {
76
+ if ( body_object . scope ( ) . shift_pressed ) {
77
+ body_object . scope ( ) . shift_pressed = false ;
74
78
}
75
79
} ) ;
76
- } ) ;
77
80
81
+ } ) ;
0 commit comments