Updated drive file list items to have IDs and close dialog
This commit is contained in:
parent
f54c2ccc51
commit
b42b71e0b6
|
@ -563,7 +563,9 @@ textarea {
|
||||||
<div id="drive-filename">Untitled ASCII Diagram</div>
|
<div id="drive-filename">Untitled ASCII Diagram</div>
|
||||||
<div style="margin: 5px;">Edit file permissions in <a href="http://drive.google.com/" target="_blank">Google Drive</a>.</div>
|
<div style="margin: 5px;">Edit file permissions in <a href="http://drive.google.com/" target="_blank">Google Drive</a>.</div>
|
||||||
<br>
|
<br>
|
||||||
<div id="drive-file-list"></div>
|
<div id="drive-file-list">
|
||||||
|
<!-- filled with li#drive-file-list-item -->
|
||||||
|
</div>
|
||||||
<button id="drive-new-file-button">New Drawing</button>
|
<button id="drive-new-file-button">New Drawing</button>
|
||||||
<div class="dialog-button-bar">
|
<div class="dialog-button-bar">
|
||||||
<button class="close-dialog-button">Close</button>
|
<button class="close-dialog-button">Close</button>
|
||||||
|
|
|
@ -619,7 +619,14 @@ function pa(a) {
|
||||||
a = a.items;
|
a = a.items;
|
||||||
for (var c in a) {
|
for (var c in a) {
|
||||||
var d = document.createElement("li");
|
var d = document.createElement("li");
|
||||||
d.innerHTML = '<a href="#' + a[c].id + '">' + a[c].title + "</a>";
|
d.id = "drive-file-list-item";
|
||||||
|
var e = document.createElement("a");
|
||||||
|
d.appendChild(e);
|
||||||
|
e.href = "#" + a[c].id;
|
||||||
|
$(e).click(function() {
|
||||||
|
$("#drive-dialog").removeClass("visible");
|
||||||
|
});
|
||||||
|
e.innerHTML = a[c].title;
|
||||||
$("#drive-file-list").append(d);
|
$("#drive-file-list").append(d);
|
||||||
}
|
}
|
||||||
}.bind(a));
|
}.bind(a));
|
||||||
|
|
|
@ -127,7 +127,12 @@ ascii.DriveController.prototype.loadFileList = function() {
|
||||||
var items = result['items'];
|
var items = result['items'];
|
||||||
for (var i in items) {
|
for (var i in items) {
|
||||||
var entry = document.createElement('li');
|
var entry = document.createElement('li');
|
||||||
entry.innerHTML = '<a href="#' + items[i]['id'] + '">' + items[i]['title'] + '</a>';
|
entry.id = "drive-file-list-item";
|
||||||
|
var title = document.createElement('a');
|
||||||
|
entry.appendChild(title);
|
||||||
|
title.href = '#' + items[i]['id'];
|
||||||
|
$(title).click(function() { $('#drive-dialog').removeClass('visible'); });
|
||||||
|
title.innerHTML = items[i]['title'];
|
||||||
$('#drive-file-list').append(entry);
|
$('#drive-file-list').append(entry);
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
Loading…
Reference in New Issue