mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 11:52:37 +09:00
feature #3748: Add isFeatureEnabled, handlebars helper
This commit is contained in:
1 parent
7f8a1fa910
commit
d520a9ffe0
2 files changed
+18
-2
No files matched your search
@@ -0,0 +1,16 @@
|
||||
define(function(require) {
|
||||
var Handlebars = require('hbs/handlebars');
|
||||
var Config = require('sunstone-config');
|
||||
|
||||
var isFeatureEnabled = function(feature, options) {
|
||||
if (Config.isFeatureEnabled(feature)) {
|
||||
return options.fn(this);
|
||||
} else {
|
||||
return options.inverse(this);
|
||||
}
|
||||
};
|
||||
|
||||
Handlebars.registerHelper('isFeatureEnabled', isFeatureEnabled);
|
||||
|
||||
return isFeatureEnabled;
|
||||
})
|
||||
@@ -3,7 +3,7 @@ define(function(require) {
|
||||
var Config = require('sunstone-config');
|
||||
|
||||
var isTabActionEnabled = function(tabName, action, options) {
|
||||
if(Config.isTabActionEnabled(tabName, action)) {
|
||||
if (Config.isTabActionEnabled(tabName, action)) {
|
||||
return options.fn(this);
|
||||
} else {
|
||||
return options.inverse(this);
|
||||
@@ -13,4 +13,4 @@ define(function(require) {
|
||||
Handlebars.registerHelper('isTabActionEnabled', isTabActionEnabled);
|
||||
|
||||
return isTabActionEnabled;
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user