Implement search autocompleter callback

feature/core
Sven Slootweg 11 years ago
parent 46be134177
commit 0599bc2531

@ -108,16 +108,7 @@ function callbackNodeCreated(form, data)
var node_id = data.node_id; var node_id = data.node_id;
form.getWindow().Close(); form.getWindow().Close();
openWindowNodeDetails(node_id);
new JsdeWindow({
width: 480,
height: 300,
x: 100,
y: 100,
title: "Node lookup",
contents: "Loading...",
source_url: "/nodes/" + node_id
});
} }
else if(data.result == "error") else if(data.result == "error")
{ {
@ -138,6 +129,19 @@ function callbackNodeCreated(form, data)
} }
} }
function openWindowNodeDetails(id)
{
new JsdeWindow({
width: 480,
height: 300,
x: 100,
y: 100,
title: "Node lookup",
contents: "Loading...",
source_url: "/nodes/" + id
});
}
/*function callbackNodeCreationFailed(form, data) /*function callbackNodeCreationFailed(form, data)
{ {
form.find("button[type=submit]").restoreIcon(); form.find("button[type=submit]").restoreIcon();
@ -246,6 +250,7 @@ $(function(){
autocompleter_search = new AutoCompleter("search"); autocompleter_search = new AutoCompleter("search");
$("#input_search_query").autoComplete(autocompleter_search, new SearchCompletionSource($("#input_search_query")), function(data){ $("#input_search_query").autoComplete(autocompleter_search, new SearchCompletionSource($("#input_search_query")), function(data){
console.log(data); openWindowNodeDetails(data.value);
this.target.val("");
}); });
}); });

Loading…
Cancel
Save