Skip to content
Permalink
Browse files

fade share if offline

  • Loading branch information...
Manuel-777 committed Sep 11, 2019
1 parent a0beec6 commit db1cedb99ab9bb8c82aac6c17d96ce653b5ccb75
Showing with 50 additions and 33 deletions.
  1. +11 −0 window_main/index.css
  2. +39 −33 window_main/match-details.js
@@ -584,6 +584,17 @@ span.top_nav_item_text {
-webkit-transition: all .2s ease-in;
}

.list_log_cant_share {
cursor: pointer;
opacity: 0.4;
width: 40px;
height: 40px;
margin: auto auto auto 8px;
background: url(../images/share.png);
-webkit-transition: all .2s ease-in;
}


.list_draft_share:hover, .list_log_share:hover {
opacity: 0.9;
}
@@ -88,40 +88,46 @@ function openMatch(id) {
});
flc.appendChild(actionLogButton);

const actionLogShareButton = createDiv(["list_log_share", match.id + "al"]);
actionLogShareButton.addEventListener("click", e => {
e.stopPropagation();
const cont = createDiv(["dialog_content"]);
cont.style.width = "500px";

cont.append(createDiv(["share_title"], "Link for sharing:"));
const icd = createDiv(["share_input_container"]);
const linkInput = createInput([], "", {
id: "share_input",
autocomplete: "off"
});
linkInput.addEventListener("click", () => linkInput.select());
icd.appendChild(linkInput);
const but = createDiv(["button_simple"], "Copy");
but.addEventListener("click", function() {
ipcSend("set_clipboard", byId("share_input").value);
});
icd.appendChild(but);
cont.appendChild(icd);

cont.appendChild(createDiv(["share_subtitle"], "<i>Expires in: </i>"));
createSelect(
cont,
["One day", "One week", "One month", "Never"],
"",
() => logShareLink(match.id),
"expire_select"
);
if (!pd.offline) {
const actionLogShareButton = createDiv(["list_log_share", match.id + "al"]);
actionLogShareButton.addEventListener("click", e => {
e.stopPropagation();
const cont = createDiv(["dialog_content"]);
cont.style.width = "500px";

cont.append(createDiv(["share_title"], "Link for sharing:"));
const icd = createDiv(["share_input_container"]);
const linkInput = createInput([], "", {
id: "share_input",
autocomplete: "off"
});
linkInput.addEventListener("click", () => linkInput.select());
icd.appendChild(linkInput);
const but = createDiv(["button_simple"], "Copy");
but.addEventListener("click", function() {
ipcSend("set_clipboard", byId("share_input").value);
});
icd.appendChild(but);
cont.appendChild(icd);

cont.appendChild(createDiv(["share_subtitle"], "<i>Expires in: </i>"));
createSelect(
cont,
["One day", "One week", "One month", "Never"],
"",
() => logShareLink(match.id),
"expire_select"
);

openDialog(cont);
logShareLink(match.id);
});
flc.appendChild(actionLogShareButton);
openDialog(cont);
logShareLink(match.id);
});
flc.appendChild(actionLogShareButton);
} else {
const actionLogCantShare = createDiv(["list_log_cant_share"]);
actionLogCantShare.title = "You need to be logged in to share!";
flc.appendChild(actionLogCantShare);
}
}
mainDiv.appendChild(flc);

0 comments on commit db1cedb

Please sign in to comment.
You can’t perform that action at this time.