Merge pull request #302 from ldinc/issue#301

added simple copy to clipboard from data-id prop
This commit is contained in:
Dan Sosedoff
2017-10-13 22:33:58 -05:00
committed by GitHub
2 changed files with 10 additions and 5 deletions

View File

@@ -190,7 +190,7 @@
<div class="connection-ssh-group"> <div class="connection-ssh-group">
<hr/> <hr/>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">SSH Host</label> <label class="col-sm-3 control-label">SSH Host</label>
<div class="col-sm-7"> <div class="col-sm-7">
@@ -200,7 +200,7 @@
<input type="text" id="ssh_port" class="form-control" placeholder="22" /> <input type="text" id="ssh_port" class="form-control" placeholder="22" />
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">SSH User</label> <label class="col-sm-3 control-label">SSH User</label>
<div class="col-sm-9"> <div class="col-sm-9">
@@ -244,6 +244,8 @@
<li class="divider"></li> <li class="divider"></li>
<li><a href="#" data-action="truncate">Truncate Table</a></li> <li><a href="#" data-action="truncate">Truncate Table</a></li>
<li><a href="#" data-action="delete">Delete Table</a></li> <li><a href="#" data-action="delete">Delete Table</a></li>
<li class="divider"></li>
<li><a href="#" data-action="copy">Copy Table Name</a></li>
</ul> </ul>
</div> </div>
<div id="databases_context_menu"> <div id="databases_context_menu">

View File

@@ -224,6 +224,9 @@ function performTableAction(table, action, el) {
var win = window.open(url, "_blank"); var win = window.open(url, "_blank");
win.focus(); win.focus();
break; break;
case "copy":
copyToClipboard(table.split('.')[1]);
break;
} }
} }
@@ -313,7 +316,7 @@ function setCurrentTab(id) {
if (id != "table_content") { if (id != "table_content") {
$("#body").removeClass("with-pagination"); $("#body").removeClass("with-pagination");
} }
$("#nav ul li.selected").removeClass("selected"); $("#nav ul li.selected").removeClass("selected");
$("#" + id).addClass("selected"); $("#" + id).addClass("selected");
@@ -490,7 +493,7 @@ function showTableStructure() {
} }
setCurrentTab("table_structure"); setCurrentTab("table_structure");
$("#input").hide(); $("#input").hide();
$("#body").prop("class", "full"); $("#body").prop("class", "full");
@@ -1143,7 +1146,7 @@ $(document).ready(function() {
$("#pg_password").val(item.password); $("#pg_password").val(item.password);
$("#pg_db").val(item.database); $("#pg_db").val(item.database);
$("#connection_ssl").val(item.ssl); $("#connection_ssl").val(item.ssl);
if (item.ssh && Object.keys(item.ssh).length > 0) { if (item.ssh && Object.keys(item.ssh).length > 0) {
$("#ssh_host").val(item.ssh.host); $("#ssh_host").val(item.ssh.host);
$("#ssh_port").val(item.ssh.port); $("#ssh_port").val(item.ssh.port);