mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Code reduction and clarification
this.innerHTML now using it's own innerHTML. Does work using dragSrcEl, but is tricky to figure out Condensed the 4 x array switches to a single for loop
This commit is contained in:
18
lib/coder.js
18
lib/coder.js
@@ -1605,7 +1605,7 @@ var ICEcoder = {
|
||||
if (e.stopPropagation) {e.stopPropagation()}
|
||||
if (ICEcoder.dragSrcEl != this) {
|
||||
ICEcoder.dragSrcEl.innerHTML = this.innerHTML.split(" ")[0] + ICEcoder.dragSrcEl.innerHTML.substr(ICEcoder.dragSrcEl.innerHTML.indexOf(" "),ICEcoder.dragSrcEl.innerHTML.length);
|
||||
this.innerHTML = e.dataTransfer.getData('text/html').split(" ")[0] + this.innerHTML.substr(ICEcoder.dragSrcEl.innerHTML.indexOf(" "),ICEcoder.dragSrcEl.innerHTML.length);
|
||||
this.innerHTML = e.dataTransfer.getData('text/html').split(" ")[0] + this.innerHTML.substr(this.innerHTML.indexOf(" "),this.innerHTML.length);
|
||||
var dragID = ICEcoder.dragSrcEl.id.substr(3,ICEcoder.dragSrcEl.id.length)*1;
|
||||
var dropID = this.id.substr(3,this.id.length)*1;
|
||||
if(dragID==top.ICEcoder.selectedTab) {
|
||||
@@ -1613,17 +1613,11 @@ var ICEcoder = {
|
||||
var b = dragID-1;
|
||||
var c = dropID-1;
|
||||
|
||||
a = top.ICEcoder.changedContent;
|
||||
a[b]=[a[c],a[c]=a[b]][0];
|
||||
|
||||
a = top.ICEcoder.openFiles;
|
||||
a[b]=[a[c],a[c]=a[b]][0];
|
||||
|
||||
a = top.ICEcoder.openFileMDTs;
|
||||
a[b]=[a[c],a[c]=a[b]][0];
|
||||
|
||||
a = top.ICEcoder.cMInstances;
|
||||
a[b]=[a[c],a[c]=a[b]][0];
|
||||
// Swap values for switched tabs in these arrays
|
||||
a = [ICEcoder.changedContent, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.cMInstances];
|
||||
for (var i=0;i<a.length;i++) {
|
||||
a[i][b]=[a[i][c],a[i][c]=a[i][b]][0];
|
||||
}
|
||||
|
||||
top.ICEcoder.switchTab(dropID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user