Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Motion Bank
MB.js
Quasar Components MoSys
Commits
3cca0cb2
Commit
3cca0cb2
authored
May 18, 2020
by
christianrhansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
highlighting selected position
parent
1fd95781
Pipeline
#59499
passed with stage
in 7 minutes and 46 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
partials/CellStyleEditor.vue
partials/CellStyleEditor.vue
+11
-7
No files found.
partials/CellStyleEditor.vue
View file @
3cca0cb2
<
template
lang=
"pug"
>
.q-mt-md
div
.bg-grey-9.q-pa-md
.q-caption.text-grey-6.q-mb-sm Image position
.text-center
template(v-for="(position, index) in css.positions")
q-btn.q-ma-xs.bg-grey-8(@click="setStyle(position)", round, size="sm", flat)
template(v-for="(position, index) in css.backgroundPositions")
q-btn.q-ma-xs(@click="setStyle(position)", round, size="sm", flat,
:class="[updatedCell && position === updatedCell.stylesheet.value ? 'bg-blue' : 'bg-grey-8']")
br(v-if="index === 2 || index === 5")
</
template
>
...
...
@@ -14,23 +15,26 @@
props
:
[
'
cell
'
],
data
()
{
return
{
updatedCell
:
{
stylesheet
:
{
value
:
undefined
}},
model
:
{
backgroundPosition
:
undefined
},
css
:
{
p
ositions
:
[
'
bg-top-left
'
,
'
bg-top
'
,
'
bg-top-right
'
,
'
bg-left
'
,
'
bg-center
'
,
'
bg-right
'
,
'
bg-bottom-left
'
,
'
bg-bottom
'
,
'
bg-bottom-right
'
]
backgroundP
ositions
:
[
'
bg-top-left
'
,
'
bg-top
'
,
'
bg-top-right
'
,
'
bg-left
'
,
'
bg-center
'
,
'
bg-right
'
,
'
bg-bottom-left
'
,
'
bg-bottom
'
,
'
bg-bottom-right
'
]
}
}
},
mounted
()
{
if
(
!
this
.
cell
.
stylesheet
.
value
)
this
.
setStyle
(
'
bg-center
'
)
},
methods
:
{
async
setStyle
(
position
)
{
console
.
log
(
position
)
let
_cell
=
this
.
cell
if
(
_cell
.
id
)
{
try
{
let
_c
=
await
this
.
$store
.
dispatch
(
'
cells/patch
'
,
[
_cell
.
id
,
{
stylesheet
:
{
value
:
position
}
}])
this
.
updatedCell
=
await
this
.
$store
.
dispatch
(
'
cells/patch
'
,
[
_cell
.
id
,
{
stylesheet
:
{
value
:
position
}
}])
// console.log('worked', this.cell)
this
.
$store
.
commit
(
'
mosys/setUpdatedCell
'
,
_c
)
this
.
$store
.
commit
(
'
mosys/setUpdatedCell
'
,
this
.
updatedCell
)
}
catch
(
err
)
{
console
.
log
(
'
error:
'
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment