fix the bug on insertAfter function in pluign-new.js
This commit is contained in:
parent
00b55e89dd
commit
e08d08c6d4
|
@ -105,4 +105,8 @@ td,th{
|
|||
#submitBehaviors p{
|
||||
margin-top:10px;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
.visited{
|
||||
background-color:#FFFBD1;
|
||||
}
|
|
@ -193,22 +193,25 @@ function showPluginMethod(plugin, method) {
|
|||
$(documentChild[j]).attr("id",parseInt(j+1));
|
||||
}
|
||||
mark=clickNode;
|
||||
pluginMethodList[mark]=behaviorData;
|
||||
} else if (place == "after") {
|
||||
mark=parseInt(clickNode+1);
|
||||
for(var j=length-1;j>=clickNode+1;j--){
|
||||
pluginMethodList[j+1]=pluginMethodList[j];
|
||||
$(documentChild[j]).attr("id",parseInt(j+1));
|
||||
if(clickNode==(length-1) && clickNode!=-1){
|
||||
pluginMethodList.push(behaviorData);
|
||||
}else{
|
||||
for(var j=length-1;j>=clickNode+1;j--){
|
||||
pluginMethodList[j+1]=pluginMethodList[j];
|
||||
$(documentChild[j]).attr("id",parseInt(j+1));
|
||||
}
|
||||
pluginMethodList[mark]=behaviorData;
|
||||
}
|
||||
|
||||
}
|
||||
$('#insertBefore').attr("class","show");
|
||||
pluginMethodList[mark]=behaviorData;
|
||||
$('#myModal_Behavior').modal('hide');
|
||||
createPluginMethodLines(behaviorData,mark);
|
||||
|
||||
createPluginMethodLines();
|
||||
}
|
||||
|
||||
function createPluginMethodLines(behaviorData,mark){
|
||||
function createPluginMethodLines(){
|
||||
document.getElementById("showPluginMethod").innerHTML="";
|
||||
document.getElementById('behaviorArea').innerHTML="";
|
||||
for(var j=0;j<pluginMethodList.length;j++){
|
||||
|
@ -216,10 +219,12 @@ function createPluginMethodLines(behaviorData,mark){
|
|||
var p = document.createElement("p");
|
||||
var i = document.createElement("i");
|
||||
var textNode = document.createTextNode(pluginMethodList[j]);
|
||||
div.setAttribute("id", j);
|
||||
i.setAttribute("class", "icon-hand-right");
|
||||
p.setAttribute("class", j);
|
||||
p.setAttribute("id", j);
|
||||
p.setAttribute("class","");
|
||||
p.setAttribute("onClick", "showMethodDocument(this)");// loadMethodParams
|
||||
p.setAttribute("style", "cursor:pointer;");
|
||||
p.setAttribute("style", "cursor:pointer;width:85%");
|
||||
p.appendChild(i);
|
||||
p.appendChild(textNode);
|
||||
div.appendChild(p);
|
||||
|
@ -229,9 +234,17 @@ function createPluginMethodLines(behaviorData,mark){
|
|||
}
|
||||
|
||||
function showMethodDocument(selectedNode) {
|
||||
clickNode = $(selectedNode).attr("class");
|
||||
clickNode = $(selectedNode).attr("id");
|
||||
var length = $("#showPluginMethod").children().length;
|
||||
var behaviorAreaChild=$('#behaviorArea').children();
|
||||
var div = $("#showPluginMethod").children();
|
||||
for(var i=0;i<length;i++){
|
||||
if(behaviorAreaChild[i].getAttribute("id")!=clickNode){
|
||||
$(behaviorAreaChild[i]).find("p").attr("class","");
|
||||
}else{
|
||||
$(behaviorAreaChild[i]).find("p").attr("class","visited");
|
||||
}
|
||||
}
|
||||
for(var j=0;j<length;j++){
|
||||
if (div[j].getAttribute("id") == clickNode) {
|
||||
$(div[j]).show();
|
||||
|
|
Loading…
Reference in New Issue