Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Responsive modals #67

Open
wants to merge 10 commits into
base: development
Choose a base branch
from
41 changes: 30 additions & 11 deletions administrator/components/com_media/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</div>

<div class="topbar row">
<div class="col-8">
<div class="col-9">
<devices></devices>
</div>
<div class="col">
Expand Down Expand Up @@ -73,7 +73,7 @@
const deviceOrder = Object.keys(this.resolution);
const activeIndex = deviceOrder.indexOf(this.activeDevice);
const styles = {
'min-width': activeIndex === 0 ? 0 : this.resolution[this.activeDevice],
'min-width': '300px',
'max-width': activeIndex === deviceOrder.length - 1 ? '100%' : this.resolution[deviceOrder[activeIndex + 1]],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import {mapGetters, mapMutations, mapState} from 'vuex';

export default {

ravisaxena23 marked this conversation as resolved.
Show resolved Hide resolved
name: 'item',
props: {
item: {
Expand All @@ -57,6 +58,7 @@
}
},
computed: {

ravisaxena23 marked this conversation as resolved.
Show resolved Hide resolved
...mapState([
'childAllowed',
'componentAllowed',
Expand All @@ -65,9 +67,12 @@
...mapGetters([
'getType'
]),

classes() {
return [
'item',
`${this.element.key>1 ? '' : 'col-10'}`,

`pagebuilder_${this.element.type} ${this.element.options.class}`,
this.element.options.component ? 'drag_component' : '',
this.element.options.message ? 'drag_message' : ''];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<modal name="add-element" role="dialog" :classes="['modal-content', 'v--modal']"
height="500" width="800px"
height="70%" width="90%" v-bind:style="{ 'overflow-y': 'auto' }"
ravisaxena23 marked this conversation as resolved.
Show resolved Hide resolved
:clickToClose="false" @opened="opened">
<div class="modal-header">
<h3 class="modal-title">{{ translate('JLIB_PAGEBUILDER_SELECT_ELEMENT') }}</h3>
Expand All @@ -10,7 +10,7 @@
</div>
<div class="modal-body">
<div class="row">
<div class="col-4">
<div class="col-12">
<div class="list-group" id="list-tab" role="tablist">
<li v-for="element in allowedChildren" data-toggle="list" role="tabpanel"
class="element-selection list-group-item list-group-item-action"
Expand All @@ -21,26 +21,26 @@
</li>
</div>
</div>
<div class="col-8 tab-content">
<div class="col-12 tab-content">
<div v-for="element in allowedChildren" :id="'list-'+element.id" class="tab-pane fade" role="tabpanel">
{{ element.description }}

<!-- TODO: generalise grid config -->
<div v-if="element.id === 'grid'" class="image-selection">
<div class="row">
<div class="col-4 icon" v-html="images.row12 + '<p>100%</p>'"
<div class="col-6 col-sm-2 icon" v-html="images.row12 + '<p>100%</p>'"
@click="selectGrid([12])" :class="{active: select == [12]}"></div>
<div class="col-4 icon" v-html="images.row66 + '<p>(50%-50%)</p>'"
<div class="col-6 col-sm-2 icon" v-html="images.row66 + '<p>(50%-50%)</p>'"
@click="selectGrid([6, 6])" :class="{active: select == [6, 6]}"></div>
<div class="col-4 icon" v-html="images.row48 + '<p>(33%-67%)</p>'"
<div class="col-6 col-sm-2 icon" v-html="images.row48 + '<p>(33%-67%)</p>'"
@click="selectGrid([4, 8])" :class="{active: select == [4, 8]}"></div>
<div class="col-4 icon" v-html="images.row84 + '<p>(67%-33%)</p>'"
<div class="col-6 col-sm-2 icon" v-html="images.row84 + '<p>(67%-33%)</p>'"
@click="selectGrid([8, 4])" :class="{active: select == [8, 4]}"></div>
<div class="col-4 icon" v-html="images.row3333 + '<p>(25%-25%-25%-25%)</p>'"
<div class="col-6 col-sm-2 icon" v-html="images.row3333 + '<p>(25%-25%-25%-25%)</p>'"
@click="selectGrid([3, 3, 3, 3])" :class="{active: select == [3, 3, 3, 3]}"></div>
<div class="col-4 icon" v-html="images.row444 + '<p>(33%-33%-33%)</p>'"
<div class="col-6 col-sm-2 icon" v-html="images.row444 + '<p>(33%-33%-33%)</p>'"
@click="selectGrid([4, 4, 4])" :class="{active: select == [4, 4, 4]}"></div>
<div class="col-4 icon" v-html="images.row363 + '<p>(25%-50%-25%)</p>'"
<div class="col-6 col-sm-2 icon" v-html="images.row363 + '<p>(25%-50%-25%)</p>'"
@click="selectGrid([3, 6, 3])" :class="{active: select == [3, 6, 3]}"></div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</button>
</li>
<li class="nav-item">
<span id="device-desc" class="nav-link"></span>
<h5><span id="device-desc" class="nav-link"></span></h5>
</li>
</ul>
</template>
Expand Down
25 changes: 18 additions & 7 deletions build/media_source/system/scss/fields/pagebuilder.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Import BS4 to remove dependency from backend template
@import "./bs4/bootstrap";

// App.vue
Expand All @@ -25,13 +24,24 @@ $zindex-sidebar: 1050;
select {
-webkit-appearance: menulist;
}
.btn-block {
display: block;
width: 100%;
max-width: fit-content;

// Vertically space out multiple block buttons
+ .btn-block {
margin-top: $btn-block-spacing-y;
}
}

button.nav-link.drag {
cursor: grab;
border: 2px solid;
border-radius: .25rem;
background-color: $yellow;
border: #fafafa;
background-color: red;
margin: auto;
color:#fafafa;
margin: 5px;

.icon-remove {
cursor: pointer;
Expand Down Expand Up @@ -66,6 +76,7 @@ button.nav-link.drag {

> .btn-wrapper {
visibility: visible;
max-width: fit-content;
}
}

Expand All @@ -80,7 +91,7 @@ button.nav-link.drag {

&.pagebuilder_container {
background-color: $light-blue;
margin: 0 10px;
margin: 0 -13px;

&:hover {
background-color: $blue;
Expand All @@ -89,7 +100,7 @@ button.nav-link.drag {

&.pagebuilder_grid {
background-color: $light-grey;
margin: 0 10px;
margin: 0 0;

> .item-content {
background: linear-gradient(to right, rgba(0, 0, 0, .1) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .1) 1px, transparent 1px);
Expand Down Expand Up @@ -245,4 +256,4 @@ button.nav-link.drag {
.form-group {
padding: 0 7.5px 15px 0;
}
}
}
ravisaxena23 marked this conversation as resolved.
Show resolved Hide resolved
Loading