mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 10:01:40 -05:00
Make useDropdowns a theme-level setting instead
This commit is contained in:
parent
a4c7fc3dd7
commit
7de249500c
9 changed files with 27 additions and 6 deletions
|
@ -12,7 +12,7 @@ Template[getTemplate('nav')].helpers({
|
|||
return !!secondaryNav.length;
|
||||
},
|
||||
dropdownClass: function () {
|
||||
return getSetting('useDropdowns', true) ? 'has-dropdown' : 'no-dropdown';
|
||||
return getThemeSetting('useDropdowns', true) ? 'has-dropdown' : 'no-dropdown';
|
||||
},
|
||||
getTemplate: function () {
|
||||
return getTemplate(this);
|
||||
|
|
|
@ -86,10 +86,6 @@ settingsSchemaObject = {
|
|||
type: Number,
|
||||
optional: true
|
||||
},
|
||||
useDropdowns: {
|
||||
type: Boolean,
|
||||
optional: true
|
||||
},
|
||||
language: {
|
||||
type: String,
|
||||
defaultValue: 'en',
|
||||
|
|
|
@ -163,3 +163,8 @@ getTemplate = function (name) {
|
|||
return !!templates[name] ? templates[name] : name;
|
||||
}
|
||||
|
||||
// ------------------------------ Theme Settings ------------------------------ //
|
||||
|
||||
themeSettings = {
|
||||
'useDropdowns': true // whether or not to use dropdown menus in a theme
|
||||
};
|
|
@ -37,6 +37,8 @@ Package.on_use(function (api) {
|
|||
'commentEditClientCallbacks',
|
||||
|
||||
'getTemplate',
|
||||
'templates'
|
||||
'templates',
|
||||
|
||||
'themeSettings'
|
||||
]);
|
||||
});
|
|
@ -11,6 +11,14 @@ getSetting = function(setting, defaultValue){
|
|||
}
|
||||
};
|
||||
|
||||
getThemeSetting = function(setting, defaultValue){
|
||||
if(typeof themeSettings[setting] !== 'undefined'){
|
||||
return themeSettings[setting];
|
||||
}else{
|
||||
return typeof defaultValue === 'undefined' ? '' : defaultValue;
|
||||
}
|
||||
};
|
||||
|
||||
camelToDash = function (str) {
|
||||
return str.replace(/\W+/g, '-').replace(/([a-z\d])([A-Z])/g, '$1-$2').toLowerCase();
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ Package.on_use(function (api) {
|
|||
'camelToDash',
|
||||
'dashToCamel',
|
||||
'getSetting',
|
||||
'getThemeSetting',
|
||||
'getSiteUrl',
|
||||
'trimWords'
|
||||
]);
|
||||
|
|
|
@ -2,6 +2,8 @@ Package.describe({summary: "Telescope base theme"});
|
|||
|
||||
Package.on_use(function (api) {
|
||||
|
||||
api.use(['telescope-lib', 'telescope-base'], ['client', 'server']);
|
||||
|
||||
api.add_files([
|
||||
'lib/client/css/screen.css',
|
||||
], ['client']);
|
||||
|
|
1
packages/telescope-theme-hubble/lib/hubble.js
Normal file
1
packages/telescope-theme-hubble/lib/hubble.js
Normal file
|
@ -0,0 +1 @@
|
|||
themeSettings.useDropdowns = true; // not strictly needed since "true" is the current default
|
|
@ -2,6 +2,12 @@ Package.describe({summary: "Telescope Hubble theme"});
|
|||
|
||||
Package.on_use(function (api) {
|
||||
|
||||
api.use(['telescope-lib', 'telescope-base'], ['client', 'server']);
|
||||
|
||||
api.add_files([
|
||||
'lib/hubble.js',
|
||||
], ['client', 'server']);
|
||||
|
||||
api.add_files([
|
||||
'lib/client/css/screen.css',
|
||||
], ['client']);
|
||||
|
|
Loading…
Add table
Reference in a new issue