X-Git-Url: https://git.yukkurigames.com/?p=mlpccg.git;a=blobdiff_plain;f=mlpccg.js;h=87e8ac3a2615e0be604e674bef0c8da9532bd0f9;hp=0e8643efc432b4189f135d425a5a6a1e8897205b;hb=HEAD;hpb=adfa2f63286a9abd44621e5d0374570a12ae0adf diff --git a/mlpccg.js b/mlpccg.js index 0e8643e..87e8ac3 100644 --- a/mlpccg.js +++ b/mlpccg.js @@ -18,6 +18,7 @@ var THEMES = [ "cadance", "celestia", "chrysalis", + "cmc", "dash", "discord", "fluttershy", @@ -170,7 +171,8 @@ window.addEventListener('DOMContentLoaded', function () { } } - FastClick.attach(document.body, { tapDelay: 50 }); + if (typeof FastClick !== "undefined") + FastClick.attach(document.body, { tapDelay: 50 }); loadTheme(); }); @@ -236,21 +238,14 @@ if (applicationCache && applicationCache.status) { } function dismiss () { - var overlay = document.getElementById("overlay"); - if (overlay) - overlay.parentNode.removeChild(overlay); - broadcast({ type: "dismiss" }); + var open = document.querySelectorAll(".dialog.open"); + for (var i = 0; i < open.length; ++i) + open[i].className = "dialog"; } function show (id) { - var overlay = document.getElementById("overlay"); - if (!overlay) { - overlay = document.createElement('div'); - overlay.id = 'overlay'; - } else { - overlay.parentNode.removeChild(overlay); - } + dismiss(); var target = document.getElementById(id); - target.parentNode.insertBefore(overlay, target); + target.className += " open"; }