Created
September 6, 2011 05:27
-
-
Save michaelrog/1196668 to your computer and use it in GitHub Desktop.
JS/jQuery to tweak Assets File Manager view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This JS/jQuery code simulates clicks that cause the Assets File Manager to: | |
- switch to List view | |
- expand the first level of subfolders | |
Simply add it to your EE2 CP via your favorite method. I suggest using Brandon Kelly's CP_JS_CSS. | |
(The timeout is a bit of a hack: Without a slight delay, expanding the subfolders doesn't work. I think this is because the file tree are loaded via AJAX-y methods, which require a wee bit of time to complete.) | |
P&T Assets: http://pixelandtonic.com/assets | |
P&T CP_JS_CSS: https://github.com/pixelandtonic/cp_css_js | |
*/ | |
$(function(){ | |
assets_fm_views = function(){ | |
// switch to list view | |
$(".assets-fm-list").click(); | |
// expand folders | |
$(".assets-fm-toggle").click(); | |
} | |
var do_it = setTimeout("assets_fm_views()", 400); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment