AEM 6410 - Touch UI set Orderable checked by default on New Folder Create Dialog


Set the Orderable checked on new Folder Create dialog, so any new folders have default type  sling:OrderedFolder

Demo | Package Install | Github


1) Login to CRXDE Lite, create folder (nt:folder) /apps/eaem-touchui-assets-folder-create-default-orderable

2) Create clientlib (type cq:ClientLibraryFolder) /apps/eaem-touchui-assets-folder-create-default-orderable/clientlib and set property categories of String[] type to dam.gui.coral.fileupload and dependencies String[] to underscore

3) Create file ( type nt:file ) /apps/eaem-touchui-assets-folder-create-default-orderable/clientlib/js.txt, add the following


4) Create file (type nt:file) /apps/eaem-touchui-assets-folder-create-default-orderable/clientlib/default-orderable.js, add the following code

(function ($, $document) {
    var DAM_CREATE_FOLDER = "#dam-create-folder",
        CREATE_FOLDER_DIALOG = "#createfolder",
        ORDERABLE_SEL = "coral-checkbox:last";

    $document.on("foundation-contentloaded", onUILoad);

    function onUILoad() {
        Coral.commons.ready($(DAM_CREATE_FOLDER), function () {

    function makeOrderableDefault(event) {
        var $orderable = $(CREATE_FOLDER_DIALOG).find(ORDERABLE_SEL);

        if (_.isEmpty($orderable)) {

        $orderable[0].checked = false;

})(jQuery, jQuery(document));

No comments:

Post a Comment