Skip to content

Commit

Permalink
Fix tree-view for mail failing on initial load
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia Rostovtsev committed May 12, 2018
1 parent b2eef79 commit b9992f7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion extensions/mail/mail.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 15 additions & 9 deletions extensions/mail/mail.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const mail = (function() {
js: v___server_js_path
},
var: {
mail: $t_uri_webmail
mail: function() {
return $t_uri_webmail
}
}
};

Expand All @@ -44,14 +46,6 @@ const mail = (function() {
},
};

// Load dependencies
(() => {
_g.load.bundle(_g.path.js + "/" + data.files.fancytree,
_g.path.css + "/" + data.files.fancytree,
(_g.var.mail ? [get] : 0), 1
);
})();

// Get folders data
function get(key) {
key = key ? ('?key=' + key.replace(/&/g, '%26')) : String();
Expand All @@ -75,6 +69,12 @@ const mail = (function() {
container: '[' + data.selectors.folders + ']',
init: function(source) {

// Load dependencies
if (typeof $.ui !== 'object') {
this.load();
return;
}

// Insert tree container
if ($(data.selectors.navigation + ' ' + this.container).length === 0) {
$(data.selectors.navigation).prepend('<div ' + data.selectors.folders + '></div>');
Expand Down Expand Up @@ -112,6 +112,12 @@ const mail = (function() {
let expanded = node.isExpanded();
!expanded && node.toggleExpanded();
},
load: function() {
_g.load.bundle(_g.path.js + "/" + data.files.fancytree,
_g.path.css + "/" + data.files.fancytree,
(_g.var.mail() ? [get] : 0), 1
);
},
reload: function(source) {
let tree = $(this.container).fancytree("getTree");
tree.$container.empty();
Expand Down
2 changes: 1 addition & 1 deletion theme.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
desc=Authentic Theme
longdesc=Webmin/Usermin/Virtualmin/Cloudmin theme based on Bootstrap and Font Awesome (https://github.com/qooob/authentic-theme)
version=19.17
mversion=3
mversion=4
depends=1.880 1.740
webmin=1
usermin=1
24 changes: 12 additions & 12 deletions unauthenticated/js/bundle.min.js

Large diffs are not rendered by default.

0 comments on commit b9992f7

Please sign in to comment.