Action correct pane - file/dir drag & fold/unfold

Focus on last instance on file/dir drag - used by pasteURL to drop URL
in correct pane
Shortcut for fold/unfold line also needed to consider pane
This commit is contained in:
Matt Pass
2014-10-29 14:54:58 +00:00
parent b797acea90
commit 3258c45eb9

View File

@@ -1398,7 +1398,7 @@ var ICEcoder = {
newLI = document.createElement("li");
newLI.className = cssStyle;
newLI.draggable = true;
newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.getcMInstance().focus()}};
newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.editorFocusInstance.indexOf('diff') == -1 ? top.ICEcoder.getcMInstance().focus() : top.ICEcoder.getcMdiffInstance().focus()}};
newLI.ondragend = function() {top.ICEcoder.dropFile(this)};
newLI.innerHTML = innerLI
locNest.nextSibling.appendChild(newLI);
@@ -1419,7 +1419,7 @@ var ICEcoder = {
newLI = document.createElement("li");
newLI.className = cssStyle;
newLI.draggable = true;
newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.getcMInstance().focus()}};
newLI.ondrag = function(event) {top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.editorFocusInstance.indexOf('diff') == -1 ? top.ICEcoder.getcMInstance().focus() : top.ICEcoder.getcMdiffInstance().focus()}};
newLI.ondragend = function() {top.ICEcoder.dropFile(this)};
newLI.innerHTML = innerLI;
// Append or insert depending on which of the above if statements is true
@@ -2983,7 +2983,7 @@ var ICEcoder = {
// Detect keys/combos plus identify our area and set the vars, perform actions
interceptKeys: function(area, evt) {
var key;
var key, cM, cMdiff, thisCM;
key = evt.keyCode ? evt.keyCode : evt.which ? evt.which : evt.charCode;
@@ -3130,10 +3130,12 @@ var ICEcoder = {
// CTRL + . (Fold/unfold current line)
} else if(key==190 && (evt.ctrlKey||top.ICEcoder.cmdKey)) {
var cM = ICEcoder.getcMInstance();
var line = cM.getCursor().line;
cM.getLine(line).indexOf("{")>-1
? top.contentFrame.codeFoldBrace(cM, line) : top.contentFrame.codeFoldTag(cM, line);
cM = ICEcoder.getcMInstance();
cMdiff = ICEcoder.getcMdiffInstance();
thisCM = top.ICEcoder.editorFocusInstance.indexOf('diff') > -1 ? cMdiff : cM;
var line = thisCM.getCursor().line;
top.contentFrame.CodeMirror.doFold(thisCM.getLine(line).indexOf("{")>-1 ? "brace" : "xml",null,"+","-",false)(thisCM, line);
return false;
// ESC in content area (Comment/Uncomment line)