Skip to content

Commit be7ba26

Browse files
pdanpdanrstoenescu
authored andcommitted
Move link edit toolbar on top (quasarframework#1335)
1 parent 95cb7b5 commit be7ba26

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

src/components/btn/btn-mixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { QIcon } from '../icon'
33

44
const sizes = {
55
rectangle: {
6-
xs: 8, sm: 11, md: 14, lg: 17, xl: 20
6+
xs: 8, sm: 12, md: 16, lg: 20, xl: 24
77
},
88
round: {
99
xs: 24, sm: 40, md: 56, lg: 72, xl: 88

src/components/editor/QEditor.js

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,19 @@ export default {
256256
})
257257
},
258258
render (h) {
259+
const toolbars = []
260+
if (!this.readonly) {
261+
const toolbarConfig = {
262+
staticClass: `q-editor-toolbar q-editor-toolbar-padding overflow-auto row no-wrap bg-${this.toolbarColor}`,
263+
'class': {
264+
'q-editor-toolbar-separator': !this.outline && !this.push
265+
}
266+
}
267+
toolbars.push(h('div', toolbarConfig, getToolbar(h, this)))
268+
if (this.editLinkUrl !== null) {
269+
toolbars.push(h('div', toolbarConfig, getLinkEditor(h, this)))
270+
}
271+
}
259272
return h(
260273
'div',
261274
{ staticClass: 'q-editor' },
@@ -274,16 +287,7 @@ export default {
274287
}
275288
},
276289
[
277-
this.readonly ? '' : h(
278-
'div',
279-
{
280-
staticClass: `q-editor-toolbar q-editor-toolbar-padding overflow-auto row no-wrap bg-${this.toolbarColor}`,
281-
'class': {
282-
'q-editor-toolbar-separator': !this.outline && !this.push
283-
}
284-
},
285-
getToolbar(h, this)
286-
),
290+
!toolbars.length ? '' : h('div', toolbars),
287291
h(
288292
'div',
289293
{
@@ -306,16 +310,6 @@ export default {
306310
}
307311
}
308312
}
309-
),
310-
this.readonly || this.editLinkUrl === null ? '' : h(
311-
'div',
312-
{
313-
staticClass: `q-editor-toolbar q-editor-toolbar-padding overflow-auto row no-wrap bg-${this.toolbarColor}`,
314-
'class': {
315-
'q-editor-toolbar-separator': !this.outline && !this.push
316-
}
317-
},
318-
getLinkEditor(h, this)
319313
)
320314
]
321315
)

0 commit comments

Comments
 (0)