OpenShot Video Editor
2.0.0
|
Ruler directives (dragging playhead functionality, progress bars, tick marks, etc...) More...
Go to the source code of this file.
Functions | |
App | directive ('tlScrollableTracks', function(){return{restrict: 'A', link:function(scope, element, attrs){element.on('scroll', function(){scroll_left_pixels=element.scrollLeft();$('#track_controls').scrollTop(element.scrollTop());$('#scrolling_ruler').scrollLeft(element.scrollLeft());$('#progress_container').scrollLeft(element.scrollLeft());});element.on('mousedown', function(e){if(e.which==2){e.preventDefault();is_scrolling=true;starting_scrollbar={x:element.scrollLeft(), y:element.scrollTop()};starting_mouse_position={x:e.pageX, y:e.pageY};element.addClass('drag_cursor');}});element.on('mousemove', function(e){if(is_scrolling){difference={x:starting_mouse_position.x-e.pageX, y:starting_mouse_position.y-e.pageY};element.scrollLeft(starting_scrollbar.x+difference.x);element.scrollTop(starting_scrollbar.y+difference.y);}});element.on('mouseup', function(e){element.removeClass('drag_cursor');});}};}) |
Variables | |
var | is_scrolling = false |
var | scroll_left_pixels = 0 |
var | starting_mouse_position = { x: 0, y: 0 } |
var | starting_scrollbar = { x: 0, y: 0 } |
Ruler directives (dragging playhead functionality, progress bars, tick marks, etc...)
Copyright (c) 2008-2014 OpenShot Studios, LLC http://www.openshotstudios.com/. This file is part of OpenShot Video Editor, an open-source project dedicated to delivering high quality video editing and animation solutions to the world. For more information visit http://www.openshot.org/.
OpenShot Video Editor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
OpenShot Video Editor is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with OpenShot Library. If not, see http://www.gnu.org/licenses/.
Definition in file ruler.js.
App directive | ( | 'tlScrollableTracks' | , |
function(){return{restrict: 'A', link:function(scope, element, attrs){element.on('scroll', function(){scroll_left_pixels=element.scrollLeft();$('#track_controls').scrollTop(element.scrollTop());$('#scrolling_ruler').scrollLeft(element.scrollLeft());$('#progress_container').scrollLeft(element.scrollLeft());});element.on('mousedown', function(e){if(e.which==2){e.preventDefault();is_scrolling=true;starting_scrollbar={x:element.scrollLeft(), y:element.scrollTop()};starting_mouse_position={x:e.pageX, y:e.pageY};element.addClass('drag_cursor');}});element.on('mousemove', function(e){if(is_scrolling){difference={x:starting_mouse_position.x-e.pageX, y:starting_mouse_position.y-e.pageY};element.scrollLeft(starting_scrollbar.x+difference.x);element.scrollTop(starting_scrollbar.y+difference.y);}});element.on('mouseup', function(e){element.removeClass('drag_cursor');});}};} | |||
) |