From c83c425e6393f3a41f7e3dcaaf1b1ca93417d84c Mon Sep 17 00:00:00 2001 From: James Wing Date: Mon, 26 Oct 2015 16:22:01 -0700 Subject: [PATCH] Adding styleClass to widget definition to bind custom css styles --- src/scripts/provider.js | 1 + src/scripts/widget.js | 4 ++++ src/templates/widget.html | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scripts/provider.js b/src/scripts/provider.js index 4d4de0a8..11f6c90b 100644 --- a/src/scripts/provider.js +++ b/src/scripts/provider.js @@ -68,6 +68,7 @@ angular.module('adf.provider', []) * - `controllerAs` - `{string=}` - A controller alias name. If present the controller will be * published to scope under the `controllerAs` name. * - `frameless` - `{boolean=}` - false if the widget should be shown in frameless mode. The default is false. + * - `styleClass` - `{object}` - space delimited string or map of classes bound to the widget. * - `template` - `{string=|function()=}` - html template as a string. * - `templateUrl` - `{string=}` - path to an html template. * - `reload` - `{boolean=}` - true if the widget could be reloaded. The default is false. diff --git a/src/scripts/widget.js b/src/scripts/widget.js index f9b368fe..6b1bdb6a 100644 --- a/src/scripts/widget.js +++ b/src/scripts/widget.js @@ -48,6 +48,10 @@ angular.module('adf') definition.frameless = w.frameless; } + if (!definition.styleClass) { + definition.styleClass = w.styleClass; + } + // set id for sortable if (!definition.wid) { definition.wid = dashboard.id(); diff --git a/src/templates/widget.html b/src/templates/widget.html index f9ac7067..2db677c1 100644 --- a/src/templates/widget.html +++ b/src/templates/widget.html @@ -1,4 +1,4 @@ -
+