Skip to content

Commit ad81873

Browse files
committed
remove redundant code
1 parent 7bedc5a commit ad81873

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

public/js/script.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ $('#to-previous').click(function () {
113113

114114
function toggleMobileTree(should_display) {
115115
if (should_display) {
116-
$('#tree').animate({'left': '0px'}, 1000, 'easeOutExpo', function () {
117-
show_tree = true;
118-
});
116+
var position = '0px';
119117
} else {
120-
$('#tree').animate({'left': '-' + $('#tree').width() + 'px'}, 1000, 'easeOutExpo', function () {
121-
show_tree = false;
122-
});
118+
var position = '-' + $('#tree').width() + 'px';
123119
}
120+
121+
$('#tree').animate({'left': position}, 1000, 'easeOutExpo', function () {
122+
show_tree = should_display;
123+
});
124124
}
125125

126126
$('#show_tree').click(function (e) {
@@ -267,18 +267,6 @@ function displayErrorResponse(jqXHR) {
267267
notify('<div style="max-height:50vh;overflow: scroll;">' + jqXHR.responseText + '</div>');
268268
}
269269

270-
function displaySuccessMessage(data) {
271-
if (data == 'OK') {
272-
var success = $('<div>').addClass('alert alert-success')
273-
.append($('<i>').addClass('fa fa-check'))
274-
.append(' File Uploaded Successfully.');
275-
$('#alerts').append(success);
276-
setTimeout(function () {
277-
success.remove();
278-
}, 2000);
279-
}
280-
}
281-
282270
var refreshFoldersAndItems = function (data) {
283271
loadFolders();
284272
if (data != 'OK') {

0 commit comments

Comments
 (0)