diff --git a/ui/dashboard/widgets/widget-wrapper.reel/_widget-wrapper.css b/ui/dashboard/widgets/widget-wrapper.reel/_widget-wrapper.css index 8f7779ec4b..5f8fb55975 100644 --- a/ui/dashboard/widgets/widget-wrapper.reel/_widget-wrapper.css +++ b/ui/dashboard/widgets/widget-wrapper.reel/_widget-wrapper.css @@ -6,30 +6,41 @@ cursor: grab; } - @nest .Sideboard & { - margin-left: 0; - margin-right: 0; - margin-top: 0; - width: 100%; - max-width: 100%; - } &.isDragging { opacity: .75; } - @media (min-width: 65em) { - width: calc(50% - 1em); - max-width: 100%; + &.Widget--small { + @media (min-width: 65em) { + width: calc(50% - 1em); + max-width: 100%; + } + + @media (min-width: 90em) { + width: calc(33.333% - 1em); + max-width: calc(50% - 1em); + } } - @media (min-width: 90em) { - width: calc(33% - .825em); - max-width: calc(50% - 1em); + &.Widget--medium { + @media (min-width: 65em) { + width: calc(100% - 1em); + } + + @media (min-width: 90em) { + width: calc(66.666% - 1em); + max-width: calc(100% - 1em); + } } - &.Widget-size-2 { width: 50%; } - &.Widget-size-3 { width: 100%; max-width: 100%;} + @nest .Sideboard & { + margin-left: 0; + margin-right: 0; + margin-top: 0; + width: 100%; + max-width: 100%; + } } .WidgetWrapper-removeButton { @@ -56,3 +67,20 @@ transform: scale(1); } } + +/* Widget Size Selector */ + +.Widget-sizeSelector { + position: absolute; + display: none; + bottom: .5rem; + left: .5rem; + font-size: .75em; + box-shadow: 0 0 4px 0px rgba(0,0,0,1); + z-index: 1; + + @nest .Main.drawer-is-open .Dashboard & { + display: block; + } + +} diff --git a/ui/dashboard/widgets/widget-wrapper.reel/widget-wrapper.css b/ui/dashboard/widgets/widget-wrapper.reel/widget-wrapper.css index 82caab5832..0a57d34055 100644 --- a/ui/dashboard/widgets/widget-wrapper.reel/widget-wrapper.css +++ b/ui/dashboard/widgets/widget-wrapper.reel/widget-wrapper.css @@ -1 +1 @@ -.WidgetWrapper{position:relative;width:100%}.Main.drawer-is-open .WidgetWrapper{cursor:-webkit-grab;cursor:grab}.Sideboard .WidgetWrapper{margin-left:0;margin-right:0;margin-top:0;width:100%;max-width:100%}.WidgetWrapper.isDragging{opacity:.75}@media (min-width:65em){.WidgetWrapper{width:calc(50% - 1em);max-width:100%}}@media (min-width:90em){.WidgetWrapper{width:calc(33% - .825em);max-width:calc(50% - 1em)}}.WidgetWrapper.Widget-size-2{width:50%}.WidgetWrapper.Widget-size-3{width:100%;max-width:100%}.WidgetWrapper-removeButton{right:-8px;right:-.5rem;top:-8px;top:-.5rem;position:absolute;width:32px;width:2rem;height:32px;height:2rem;background:#e0003a;border-radius:50%;padding:8px;padding:.5rem;color:#fff;box-shadow:0 2px 2px 1px rgba(0,0,0,.3);visibility:hidden;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:visibility .25s ease-in-out,-webkit-transform .25s ease-in-out;transition:visibility .25s ease-in-out,-webkit-transform .25s ease-in-out;transition:transform .25s ease-in-out,visibility .25s ease-in-out;transition:transform .25s ease-in-out,visibility .25s ease-in-out,-webkit-transform .25s ease-in-out}.WidgetWrapper-removeButton:hover{background:#cc0036}.Main.drawer-is-open .WidgetWrapper-removeButton{visibility:visible;-webkit-transform:scale(1);transform:scale(1)} \ No newline at end of file +.WidgetWrapper{position:relative;width:100%}.Main.drawer-is-open .WidgetWrapper{cursor:-webkit-grab;cursor:grab}.WidgetWrapper.isDragging{opacity:.75}@media (min-width:65em){.WidgetWrapper.Widget--small{width:calc(50% - 1em);max-width:100%}}@media (min-width:90em){.WidgetWrapper.Widget--small{width:calc(33.333% - 1em);max-width:calc(50% - 1em)}}@media (min-width:65em){.WidgetWrapper.Widget--medium{width:calc(100% - 1em)}}@media (min-width:90em){.WidgetWrapper.Widget--medium{width:calc(66.666% - 1em);max-width:calc(100% - 1em)}}.Sideboard .WidgetWrapper{margin-left:0;margin-right:0;margin-top:0;width:100%;max-width:100%}.WidgetWrapper-removeButton{right:-8px;right:-.5rem;top:-8px;top:-.5rem;position:absolute;width:32px;width:2rem;height:32px;height:2rem;background:#e0003a;border-radius:50%;padding:8px;padding:.5rem;color:#fff;box-shadow:0 2px 2px 1px rgba(0,0,0,.3);visibility:hidden;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:visibility .25s ease-in-out,-webkit-transform .25s ease-in-out;transition:visibility .25s ease-in-out,-webkit-transform .25s ease-in-out;transition:transform .25s ease-in-out,visibility .25s ease-in-out;transition:transform .25s ease-in-out,visibility .25s ease-in-out,-webkit-transform .25s ease-in-out}.WidgetWrapper-removeButton:hover{background:#cc0036}.Main.drawer-is-open .WidgetWrapper-removeButton{visibility:visible;-webkit-transform:scale(1);transform:scale(1)}.Widget-sizeSelector{position:absolute;display:none;bottom:8px;bottom:.5rem;left:8px;left:.5rem;font-size:.75em;box-shadow:0 0 4px 0 #000;z-index:1}.Main.drawer-is-open .Dashboard .Widget-sizeSelector{display:block} \ No newline at end of file diff --git a/ui/dashboard/widgets/widget-wrapper.reel/widget-wrapper.html b/ui/dashboard/widgets/widget-wrapper.reel/widget-wrapper.html index e0d371ce32..7cb2e1451f 100644 --- a/ui/dashboard/widgets/widget-wrapper.reel/widget-wrapper.html +++ b/ui/dashboard/widgets/widget-wrapper.reel/widget-wrapper.html @@ -6,7 +6,12 @@ { "owner": { "properties": { - "element": {"#": "owner"} + "element": {"#": "owner"}, + "sizeOptions": [ + {"value": "small", "label": "small"}, + {"value": "medium", "label": "medium"}, + {"value": "large", "label": "large"} + ] } }, @@ -20,12 +25,21 @@ "object": {"<-": "@owner.object"} } }, - "removeWidgetButton": { "prototype": "montage/ui/button.reel", "properties": { "element": {"#": "removeButton"} } + }, + "sizeSelector": { + "prototype": "blue-shark/ui/tabs.reel", + "properties": { + "element": {"#": "sizeSelector"} + }, + "bindings": { + "options": {"<-": "@owner.sizeOptions"}, + "selection": {"<->": "@owner.size"} + } } } @@ -36,6 +50,7 @@ +