Conflicts:
	Bench4Q-Web/src/main/webapp/script/editor/usePlugin.js
This commit is contained in:
hmm 2014-08-21 13:38:38 +08:00
commit ee901e8633
2 changed files with 14 additions and 19 deletions

View File

@ -79,7 +79,7 @@ function jstreeCreate(containerId){
"themes" : { "stripes" : true } "themes" : { "stripes" : true }
}, },
"types" : { "types" : {
"#" : { "max_depth" : 4, "valid_children" : ["page"] }, "#" : { "max_depth" : 4, "valid_children" : ["page","default"] },
"page" : { "icon" : false, "valid_children" : ["batch"] }, "page" : { "icon" : false, "valid_children" : ["batch"] },
"batch" : { "icon" : false, "valid_children" : ["default"] }, "batch" : { "icon" : false, "valid_children" : ["default"] },
"default" : { "icon" : false, "valid_children" : [] } "default" : { "icon" : false, "valid_children" : [] }

View File

@ -18,9 +18,7 @@ function UsePlugin() {
$("#addPlugin").addClass("clicked"); $("#addPlugin").addClass("clicked");
$("#selectUsePlugin").modal('show'); $("#selectUsePlugin").modal('show');
}); });
$("#deletePlugin").click(function() {
});
$("#selectUsePlugin #ok").click( $("#selectUsePlugin #ok").click(
function() { function() {
var pluginName = $( var pluginName = $(
@ -36,30 +34,26 @@ function UsePlugin() {
// "usePlugin",pluginModel.name)); // "usePlugin",pluginModel.name));
usePlugin.map.put(pluginModel.id, pluginModel); usePlugin.map.put(pluginModel.id, pluginModel);
usePlugin.updateUsePlugin(); usePlugin.updateUsePlugin();
usePlugin.createEditor(pluginModel); usePlugin.createEditor(pluginModel);
usePlugin.index++; usePlugin.index++;
$("#selectUsePlugin").modal('hide'); $("#selectUsePlugin").modal('hide');
}); });
$("#selectUsePlugin #cancel").click(function() { $("#selectUsePlugin #cancel").click(function() {
$("#selectUsePlugin").modal('hide'); $("#selectUsePlugin").modal('hide');
}); });
$("#removePlugin").click( $("#removePlugin").click(
function() { function() {
var pluginId = $( var pluginId = getSelectedNodes(usePlugin.containerId);
"#usePluginList input[name='usePlugin']:checked").attr( if (!pluginId.length) {
"id");
if (pluginId == undefined) {
return; return;
} else {
usePlugin.map.remove(pluginId);
usePlugin.usePluginEditorMap.remove(pluginId);
usePlugin.createUsePlugin(usePlugin.map);
} }
usePlugin.map.remove(pluginId);
usePlugin.usePluginEditorMap.remove(pluginId);
jstreeDeleteNode(usePlugin.containerId);
// usePlugin.createUsePlugin(usePlugin.map);
$("#usePluginEditor").attr("usePlugin", ""); $("#usePluginEditor").attr("usePlugin", "");
$("#usePluginEditor").html(""); $("#usePluginEditor").html("");
@ -68,6 +62,7 @@ function UsePlugin() {
$("#usePluginList").html(""); $("#usePluginList").html("");
usePlugin.map.clear(); usePlugin.map.clear();
usePlugin.usePluginEditorMap.clear(); usePlugin.usePluginEditorMap.clear();
//jstreeClearNode(usePlugin.containerId);
}); });
this.createUsePlugin = function(map) { this.createUsePlugin = function(map) {
$("#usePluginList").html(""); $("#usePluginList").html("");