From 17e4d658149937d95e28508584772cd7506fad6c Mon Sep 17 00:00:00 2001 From: Nick Holub Date: Wed, 27 Aug 2014 16:01:17 -0700 Subject: [PATCH] fix #82 Ability to control widget container/outer style (e.g. for float) --- dist/angular-ui-dashboard.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dist/angular-ui-dashboard.js b/dist/angular-ui-dashboard.js index c2ac40d..03ede38 100644 --- a/dist/angular-ui-dashboard.js +++ b/dist/angular-ui-dashboard.js @@ -791,6 +791,7 @@ angular.module('ui.dashboard') var widgetObject = { title: widget.title, name: widget.name, + style: widget.style, size: widget.size, dataModelOptions: widget.dataModelOptions, storageHash: widget.storageHash, @@ -1052,14 +1053,15 @@ angular.module('ui.dashboard') settingsModalOptions: Class.settingsModalOptions, onSettingsClose: Class.onSettingsClose, onSettingsDismiss: Class.onSettingsDismiss, - style: Class.style, - size: Class.size || {}, - containerStyle: { width: '33%' }, // default width - contentStyle: {} + style: Class.style || {}, + size: Class.size || {} }; overrides = overrides || {}; angular.extend(this, angular.copy(defaults), overrides); + this.containerStyle = { width: '33%' }; // default width + this.contentStyle = {}; + this.updateContainerStyle(this.style); if (Class.templateUrl) { this.templateUrl = Class.templateUrl; @@ -1112,8 +1114,17 @@ angular.module('ui.dashboard') this.updateSize(this.contentStyle); }, + setStyle: function (style) { + this.style = style; + this.updateContainerStyle(style); + }, + updateSize: function (size) { angular.extend(this.size, size); + }, + + updateContainerStyle: function (style) { + angular.extend(this.containerStyle, style); } };