How to use the selector.other function in selector

To help you get started, we’ve selected a few selector examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rukzuk / rukzuk / app / sets / rukzuk / rz_core / modules / rz_selector_elements / assets / notlive / selectors.js View on Github external
$.each(allSelectors, function (module, selectors) {

                // only add the default "All X Modules" selector
                if (selectors === true) {
                    selectors = [];
                }

                // use id as initial moduleName
                var moduleName = module;

                // customize module name
                if (module === 'other') {
                    moduleName = i18n['selector.other'];
                } else {
                    // fetch module name, if module is an moduleId
                    var moduleInfo = CMS.getModule(module);
                    if (moduleInfo) {
                        moduleName = moduleInfo.name;
                    }

                    // add All  Modules selector
                    var allXModulesTitle = JSON.parse(JSON.stringify(i18n['selector.allXModules'])) || ['{moduleName}'];
                    Object.keys(allXModulesTitle).forEach(function (key) {
                        allXModulesTitle[key] = allXModulesTitle[key].replace('{moduleName}', moduleName);
                    });

                    var allXModulesSelector = '.' + module; // TODO: legacy modules added &.moduleId
                    selectors.unshift({title: allXModulesTitle, selector: allXModulesSelector});
                }