close #18; fix #30 bug but does not add the tooltip

pull/144/head
Henrique Dias 2016-10-01 13:55:55 +01:00
parent 98192fdbf9
commit 528f47b68e
3 changed files with 57 additions and 45 deletions

View File

@ -617,6 +617,7 @@ header div {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
position: relative;
}
#toolbar p,
@ -685,6 +686,8 @@ header .prev-links:hover {
header .prev-links {
position: absolute;
top: 0;
left: 0;
color: #7d7d7d;
list-style: none;
margin: 0;
@ -693,8 +696,9 @@ header .prev-links {
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
border-radius: .2em;
flex-direction: column-reverse;
left: 1.5em;
display: none;
transition: .2s ease all;
min-width: 12em;
}
header .prev-links a {
@ -705,13 +709,13 @@ header .prev-links a {
header .prev-links a:first-child {
border: 0;
border-bottom-right-radius: .5em;
border-bottom-left-radius: .5em;
border-bottom-right-radius: .2em;
border-bottom-left-radius: .2em;
}
header .prev-links a:last-child {
border-top-right-radius: .5em;
border-top-left-radius: .5em;
border-top-right-radius: .2em;
border-top-left-radius: .2em;
}
header .prev-links a:hover {

View File

@ -198,13 +198,14 @@ var reloadListing = function(callback) {
link.addEventListener('click', itemClickEvent);
});
updateToken();
if (typeof callback == 'function') {
callback();
}
}
}
}
updateToken();
}
// Rename file event
@ -383,15 +384,29 @@ var handleViewType = function(viewList) {
if (viewList == "true") {
listing.classList.add('list');
button.innerHTML = '<i class="material-icons">view_module</i> <span>Switch view</span>';
button.innerHTML = '<i class="material-icons" title="Switch View">view_module</i> <span>Switch view</span>';
return false;
}
button.innerHTML = '<i class="material-icons">view_list</i> <span>Switch view</span>';
button.innerHTML = '<i class="material-icons" title="Switch View">view_list</i> <span>Switch view</span>';
listing.classList.remove('list');
return false;
}
var addNewDirEvents = function() {
document.getElementById('new').addEventListener('click', event => {
let newdir = document.getElementById('newdir');
newdir.classList.add('enabled');
newdir.focus();
});
document.getElementById('newdir').addEventListener('blur', event => {
document.getElementById('newdir').classList.remove('enabled');
});
document.getElementById('newdir').addEventListener('keydown', newDirEvent);
}
// Handles the new directory event
var newDirEvent = function(event) {
if (event.keyCode == 27) {
@ -414,11 +429,14 @@ var newDirEvent = function(event) {
request.onreadystatechange = function() {
if (request.readyState == 4) {
button.changeToDone((request.status != 200), html);
reloadListing();
reloadListing(() => {
addNewDirEvents();
});
}
}
}
}
return false;
}
// Handles the event when there is change on selected elements
@ -550,17 +568,7 @@ document.addEventListener('listing', event => {
document.getElementById("upload-input").click();
});
document.getElementById('new').addEventListener('click', event => {
let newdir = document.getElementById('newdir');
newdir.classList.add('enabled');
newdir.focus();
});
document.getElementById('newdir').addEventListener('blur', event => {
document.getElementById('newdir').classList.remove('enabled');
});
document.getElementById('newdir').addEventListener('keydown', newDirEvent);
addNewDirEvents();
// Drag and Drop
let items = document.getElementsByClassName('item');

View File

@ -242,9 +242,9 @@ func newDirectory(w http.ResponseWriter, r *http.Request, c *config.Config) (int
var err error
if extension == "" {
err = os.MkdirAll(path, 0755)
err = os.MkdirAll(path, 0775)
} else {
err = ioutil.WriteFile(path, []byte(""), 0755)
err = ioutil.WriteFile(path, []byte(""), 0775)
}
if err != nil {