Skip to content

Commit d32092c

Browse files
committed
adding scroll and resize events
1 parent 42c7a8d commit d32092c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cmjs-shell",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"license": "MIT",
55
"description": "Command shell based on CodeMirror.",
66
"keywords": ["shell", "console"],

shell.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,18 @@ var Shell = function( CodeMirror_, opts ){
906906
instance.hide_function_tip( true );
907907
}
908908
});
909-
909+
910+
// notification listener for CM scroll event,
911+
// which may be more useful that normal scroll event
912+
if( opts.scroll ){
913+
cm.on( "scroll", opts.scroll );
914+
}
915+
916+
// notification listener for CM viewport change event
917+
if( opts.viewport_change ){
918+
cm.on( "viewportChange", opts.viewport_change );
919+
};
920+
910921
cm.on( "beforeChange", function(cm, e){
911922

912923
// todo: split paste into separate lines,

0 commit comments

Comments
 (0)