Skip to content

Commit 3c708d9

Browse files
committed
Fixed Top Frame Navigation Bug
1 parent df6a0f4 commit 3c708d9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coolhue",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"homepage": "https://webkul.github.io/coolhue/",
55
"authors": [
66
"Nitish Kumar <[email protected]>"

scripts/script.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ document.addEventListener("DOMContentLoaded", function () {
2727
nodeGradient.style.backgroundImage = tempImage;
2828
var nodeActions = document.createElement("div");
2929
nodeActions.classList.add("ch-actions");
30-
var nodeCode = document.createElement("span");
30+
var nodeCode = document.createElement("a");
3131
nodeCode.classList.add("ch-code");
3232
nodeCode.dataset.colorFrom = tempColorFrom;
3333
nodeCode.dataset.colorTo = tempColorTo;
3434

35-
var nodeGrab = document.createElement("span");
35+
var nodeGrab = document.createElement("a");
3636
nodeGrab.classList.add("ch-grab");
3737
nodeGrab.dataset.colorFrom = tempColorFrom;
3838
nodeGrab.dataset.colorTo = tempColorTo;
@@ -121,7 +121,10 @@ document.addEventListener("DOMContentLoaded", function () {
121121
tempGradient.addColorStop(1, eventColorTo);
122122
ctx.fillStyle = tempGradient;
123123
ctx.fillRect(0, 0, 500, 500);
124-
window.open(canvas.toDataURL());
124+
var dataURL = canvas.toDataURL();
125+
event.target.href = dataURL;
126+
var fileName = "coolHue-" + eventColorFrom.slice(1, 7) + "-" + eventColorTo.slice(1, 7);
127+
event.target.setAttribute("download", fileName);
125128
}
126129
}
127130

0 commit comments

Comments
 (0)