Merge branch 'development' into 'master'

Fixed listener not removing after context menu closes

See merge request xevidos/codiad!26
This commit is contained in:
Isaac Brown 2019-01-22 14:43:59 -05:00
commit 8fa741a9d6
2 changed files with 12 additions and 15 deletions

View File

@ -205,15 +205,12 @@
.removeClass('disabled');
}
// Hide menu
$('#file-manager, #editor-region')
.on('mouseover', function() {
/**
* make sure that the user has moved their mouse far enough
* away from the context menu to warrant a close.
*/
$('#file-manager, #editor-region').on( 'mousemove', codiad.filemanager.contextCheckMouse );
});
/**
* make sure that the user has moved their mouse far enough
* away from the context menu to warrant a close.
*/
$('#file-manager, #editor-region').on( 'mousemove', codiad.filemanager.contextCheckMouse );
/* Notify listeners. */
amplify.publish('context-menu.onShow', {e: e, path: path, type: type});
// Hide on click
@ -226,11 +223,11 @@
contextCheckMouse: function( e ) {
let offset = $('#context-menu').offset();
let bottom = offset.top + $('#context-menu').outerHeight( true ) + 10;
let left = offset.left - 10;
let right = offset.left + $('#context-menu').outerWidth( true ) + 10;
let top = offset.top - 10;
console.log( e );
let bottom = offset.top + $('#context-menu').outerHeight( true ) + 20;
let left = offset.left - 20;
let right = offset.left + $('#context-menu').outerWidth( true ) + 20;
let top = offset.top - 20;
if( ( e.clientX > right || e.clientX < left ) || ( e.clientY > bottom || e.clientY < top ) ) {
$('#file-manager, #editor-region').off( 'mousemove', codiad.filemanager.contextCheckMouse );

View File

@ -12,7 +12,7 @@ class Update {
// CONSTANTS
//////////////////////////////////////////////////////////////////
CONST VERSION = "v.2.9.3.4";
CONST VERSION = "v.2.9.3.5";
//////////////////////////////////////////////////////////////////
// PROPERTIES