diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2013-08-24 17:13:16 -0400 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2013-08-24 17:13:16 -0400 |
commit | 2e1bfd32991ce1de81dd6f0f2fb5a4dbbc3bf569 (patch) | |
tree | 20a61e92baa3722c7784b0480368a5d38f7692f9 /www/js/api.js | |
parent | 32a2ef87ded92abdfae94548f42a6442deef3b2b (diff) | |
download | html5ks-2e1bfd32991ce1de81dd6f0f2fb5a4dbbc3bf569.tar.xz html5ks-2e1bfd32991ce1de81dd6f0f2fb5a4dbbc3bf569.zip |
fix various minor bugs
Diffstat (limited to 'www/js/api.js')
-rw-r--r-- | www/js/api.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/www/js/api.js b/www/js/api.js index e978301..580de6a 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -171,10 +171,15 @@ window.html5ks.api = { window: function (action, transition) { var windw = html5ks.elements.window, deferred = when.defer(); - if (action === "show") { - windw.style.display = "block"; - } else { - windw.style.display = "none"; + switch (action) { + case "show": + windw.style.display = "block"; + break; + case "hide": + windw.style.display = "none"; + break; + default: + return windw.style.display !== "none"; } deferred.resolve(action); return deferred.promise; |