Handle the download button by calling the download controller; add some style
This commit is contained in:
parent
1eb940dc29
commit
4c63e00e82
|
@ -21,8 +21,8 @@ $(document).ready(function() {
|
|||
.hover(function() { $(this).find(".comments").fadeIn(); },
|
||||
function() { $(this).find(".comments").fadeOut(); });
|
||||
this.find(".delete").click({ id: this.attr("id"),
|
||||
element: this },
|
||||
delete_draggable);
|
||||
element: this }, delete_draggable);
|
||||
this.find(".download").click({ id: this.attr("id") }, download_draggable);
|
||||
this.find(".title").editable('draggables/' + this.attr("id"),
|
||||
{ tooltip: "Click to edit…",
|
||||
name: 'title',
|
||||
|
@ -101,6 +101,12 @@ function delete_draggable(event) {
|
|||
}, "json");
|
||||
}
|
||||
|
||||
// Download a draggable from the server.
|
||||
function download_draggable(event) {
|
||||
event.preventDefault();
|
||||
window.open("download/" + event.data.id);
|
||||
}
|
||||
|
||||
// Raise the draggable to the foreground.
|
||||
function raise_draggable(event) {
|
||||
var max = 0;
|
||||
|
|
|
@ -108,6 +108,7 @@ pre {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.draggable h2 .download,
|
||||
.draggable h2 .delete {
|
||||
width: auto;
|
||||
float: right;
|
||||
|
@ -116,7 +117,12 @@ pre {
|
|||
color: #ccc;
|
||||
}
|
||||
|
||||
.draggable h2 .delete:hover {
|
||||
.draggable h2 .download {
|
||||
margin-right: 4px;
|
||||
padding: 0px 4px;
|
||||
}
|
||||
|
||||
.draggable h2 :hover {
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
Reference in New Issue