diff options
-rw-r--r-- | src/js/app.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/js/app.js b/src/js/app.js index 3df6674..48c2b57 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -87,6 +87,27 @@ function load_application_list() { }); } +export function display(app) { + var appId = app.getAttribute('app-id'); + var ws = new afb.ws(function() { + var api_verb = "homescreen/showWindow"; + var request = {application_id: appId, area: "normal.full"}; + ws.call(api_verb, request).then( + function(obj) { + log("success: " + obj.response); + }, + function(obj) { + //TODO Manage errors + log("failure on display"); + } + ); + }, + function() { + //TODO Manage errors + log("ws aborted"); + }); +} + export function launch(app) { var appId = app.getAttribute('app-id'); var ws = new afb.ws(function() { @@ -95,10 +116,11 @@ export function launch(app) { ws.call(api_verb, request).then( function(obj) { log("success: " + obj.response); + display(app); }, function(obj) { //TODO Manage errors - log("failure"); + log("failure on launch"); } ); }, |