Skip to content

Commit

Permalink
fix #82 Ability to control widget container/outer style (e.g. for float)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickholub committed Aug 27, 2014
1 parent d8f40b0 commit 17e4d65
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions dist/angular-ui-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
};

Expand Down

0 comments on commit 17e4d65

Please sign in to comment.