mirror of
https://github.com/xevidos/codiad.git
synced 2024-12-22 13:52:16 +01:00
Merge branch 'development' into 'master'
Fixed issue where context menu showed incorrect slides, Fixed accidental... See merge request xevidos/codiad!25
This commit is contained in:
commit
e97b893c4c
3 changed files with 30 additions and 19 deletions
|
@ -110,7 +110,7 @@
|
|||
{
|
||||
"title": "Break",
|
||||
"icon": null,
|
||||
"applies-to" : "both no-external",
|
||||
"applies-to" : "directory-only",
|
||||
"onclick": null
|
||||
},
|
||||
{
|
||||
|
|
|
@ -153,28 +153,19 @@
|
|||
contextMenuShow: function(e, path, type, name) {
|
||||
var _this = this;
|
||||
|
||||
$('#context-menu a, #context-menu hr').hide();
|
||||
// Selective options
|
||||
switch (type) {
|
||||
case 'directory':
|
||||
$('#context-menu .directory-only, #context-menu .non-root')
|
||||
.show();
|
||||
$('#context-menu .file-only, #context-menu .root-only')
|
||||
.hide();
|
||||
$('#context-menu .directory-only, #context-menu .non-root, #context-menu .both').show();
|
||||
break;
|
||||
case 'file':
|
||||
$('#context-menu .directory-only, #context-menu .root-only')
|
||||
.hide();
|
||||
$('#context-menu .file-only,#context-menu .non-root')
|
||||
.show();
|
||||
$('#context-menu .file-only, #context-menu .non-root, #context-menu .both').show();
|
||||
break;
|
||||
case 'root':
|
||||
$('#context-menu .directory-only, #context-menu .root-only')
|
||||
.show();
|
||||
$('#context-menu .non-root, #context-menu .file-only')
|
||||
.hide();
|
||||
$('#context-menu .directory-only, #context-menu .root-only').show();
|
||||
break;
|
||||
case 'editor':
|
||||
$('#context-menu a, #context-menu hr').hide();
|
||||
$('#context-menu .editor-only').show();
|
||||
break;
|
||||
}
|
||||
|
@ -216,7 +207,12 @@
|
|||
// Hide menu
|
||||
$('#file-manager, #editor-region')
|
||||
.on('mouseover', function() {
|
||||
_this.contextMenuHide();
|
||||
|
||||
/**
|
||||
* 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});
|
||||
|
@ -227,6 +223,21 @@
|
|||
});
|
||||
},
|
||||
|
||||
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 );
|
||||
if( ( e.clientX > right || e.clientX < left ) || ( e.clientY > bottom || e.clientY < top ) ) {
|
||||
|
||||
$('#file-manager, #editor-region').off( 'mousemove', codiad.filemanager.contextCheckMouse );
|
||||
codiad.filemanager.contextMenuHide();
|
||||
}
|
||||
},
|
||||
|
||||
contextMenuHide: function() {
|
||||
$('#context-menu')
|
||||
.fadeOut(200);
|
||||
|
|
|
@ -12,7 +12,7 @@ class Update {
|
|||
// CONSTANTS
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
CONST VERSION = "v.2.9.3.3";
|
||||
CONST VERSION = "v.2.9.3.4";
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// PROPERTIES
|
||||
|
@ -148,7 +148,7 @@ class Update {
|
|||
|
||||
//echo var_dump( $response );
|
||||
//return "[".formatJSEND("success", array("currentversion"=>$local[0]['version'],"remoteversion"=>$latest,"message"=>$message,"archive"=>$archive,"nightly"=>$nightly,"name"=>$local[0]['name']))."]";
|
||||
return "[".formatJSEND("success", array("currentversion"=>$current_version,"remoteversion"=>$response["name"],"message"=>$response["release"]["description"],"archive"=>$archive,"nightly"=>$nightly,"name"=>$response["commit"]["author_name"]))."]";
|
||||
return "[".formatJSEND("success", array("currentversion"=>$current_version,"remoteversion"=>$response["name"],"message"=>$response["message"],"archive"=>$archive,"nightly"=>$nightly,"name"=>$response["commit"]["author_name"]))."]";
|
||||
}
|
||||
|
||||
function CheckProtocol() {
|
||||
|
|
Loading…
Reference in a new issue