Skip to content

Commit 93d6da0

Browse files
committed
perf(ui): Small tweaks to various areas
1 parent 5b8f1d9 commit 93d6da0

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

ui/src/components/chip/QChip.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default Vue.extend({
119119
__getContent (h) {
120120
const child = []
121121

122-
this.isClickable && child.push(
122+
this.isClickable === true && child.push(
123123
h('div', { staticClass: 'q-focus-helper' })
124124
)
125125

@@ -166,19 +166,19 @@ export default Vue.extend({
166166
render (h) {
167167
if (this.value === false) { return }
168168

169-
const data = this.isClickable ? {
169+
const data = {
170+
staticClass: 'q-chip row inline no-wrap items-center',
171+
class: this.classes,
172+
style: this.style
173+
}
174+
175+
this.isClickable === true && Object.assign(data, {
170176
attrs: { tabindex: this.computedTabindex },
171177
on: cache(this, 'click', {
172178
click: this.__onClick,
173179
keyup: this.__onKeyup
174180
}),
175181
directives: [{ name: 'ripple', value: this.ripple }]
176-
} : {}
177-
178-
Object.assign(data, {
179-
staticClass: 'q-chip row inline no-wrap items-center',
180-
class: this.classes,
181-
style: this.style
182182
})
183183

184184
return h('div', data, this.__getContent(h))

ui/src/components/color/QColor.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export default Vue.extend({
240240
h('input', {
241241
staticClass: 'fit',
242242
domProps: { value: this.model[this.topView] },
243-
attrs: !this.editable ? {
243+
attrs: this.editable !== true ? {
244244
readonly: true
245245
} : null,
246246
on: cache(this, 'topIn', {
@@ -336,11 +336,11 @@ export default Vue.extend({
336336
ref: 'spectrum',
337337
staticClass: 'q-color-picker__spectrum non-selectable relative-position cursor-pointer',
338338
style: this.spectrumStyle,
339-
class: { readonly: !this.editable },
340-
on: this.editable
339+
class: { readonly: this.editable !== true },
340+
on: this.editable === true
341341
? cache(this, 'spectrT', { click: this.__spectrumClick })
342342
: null,
343-
directives: this.editable
343+
directives: this.editable === true
344344
? cache(this, 'spectrDir', [{
345345
name: 'touch-pan',
346346
modifiers: {
@@ -373,7 +373,7 @@ export default Vue.extend({
373373
min: 0,
374374
max: 360,
375375
fillHandleAlways: true,
376-
readonly: !this.editable
376+
readonly: this.editable !== true
377377
},
378378
on: cache(this, 'hueSlide', {
379379
input: this.__onHueChange,
@@ -389,7 +389,7 @@ export default Vue.extend({
389389
min: 0,
390390
max: 100,
391391
fillHandleAlways: true,
392-
readonly: !this.editable
392+
readonly: this.editable !== true
393393
},
394394
on: cache(this, 'alphaSlide', {
395395
input: value => this.__onNumericChange({ target: { value } }, 'a', 100),
@@ -413,7 +413,7 @@ export default Vue.extend({
413413
max: 255,
414414
color: 'red',
415415
dark: this.isDark,
416-
readonly: !this.editable
416+
readonly: this.editable !== true
417417
},
418418
on: cache(this, 'rSlide', {
419419
input: value => this.__onNumericChange({ target: { value } }, 'r', 255),
@@ -426,7 +426,7 @@ export default Vue.extend({
426426
},
427427
attrs: {
428428
maxlength: 3,
429-
readonly: !this.editable
429+
readonly: this.editable !== true
430430
},
431431
on: cache(this, 'rIn', {
432432
input: evt => this.__onNumericChange(evt, 'r', 255),
@@ -444,7 +444,7 @@ export default Vue.extend({
444444
max: 255,
445445
color: 'green',
446446
dark: this.isDark,
447-
readonly: !this.editable
447+
readonly: this.editable !== true
448448
},
449449
on: cache(this, 'gSlide', {
450450
input: value => this.__onNumericChange({ target: { value } }, 'g', 255),
@@ -457,7 +457,7 @@ export default Vue.extend({
457457
},
458458
attrs: {
459459
maxlength: 3,
460-
readonly: !this.editable
460+
readonly: this.editable !== true
461461
},
462462
on: cache(this, 'gIn', {
463463
input: evt => this.__onNumericChange(evt, 'g', 255),
@@ -474,7 +474,7 @@ export default Vue.extend({
474474
min: 0,
475475
max: 255,
476476
color: 'blue',
477-
readonly: !this.editable,
477+
readonly: this.editable !== true,
478478
dark: this.isDark
479479
},
480480
on: cache(this, 'bSlide', {
@@ -488,7 +488,7 @@ export default Vue.extend({
488488
},
489489
attrs: {
490490
maxlength: 3,
491-
readonly: !this.editable
491+
readonly: this.editable !== true
492492
},
493493
on: cache(this, 'bIn', {
494494
input: evt => this.__onNumericChange(evt, 'b', 255),
@@ -503,7 +503,7 @@ export default Vue.extend({
503503
props: {
504504
value: this.model.a,
505505
color: 'grey',
506-
readonly: !this.editable,
506+
readonly: this.editable !== true,
507507
dark: this.isDark
508508
},
509509
on: cache(this, 'aSlide', {
@@ -517,7 +517,7 @@ export default Vue.extend({
517517
},
518518
attrs: {
519519
maxlength: 3,
520-
readonly: !this.editable
520+
readonly: this.editable !== true
521521
},
522522
on: cache(this, 'aIn', {
523523
input: evt => this.__onNumericChange(evt, 'a', 100),

ui/src/components/range/QRange.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export default Vue.extend({
156156
},
157157

158158
minEvents () {
159-
if (this.editable && !this.$q.platform.is.mobile && this.dragOnlyRange !== true) {
159+
if (this.editable === true && this.$q.platform.is.mobile !== true && this.dragOnlyRange !== true) {
160160
return {
161161
focus: () => { this.__focus('min') },
162162
blur: this.__blur,
@@ -167,7 +167,7 @@ export default Vue.extend({
167167
},
168168

169169
maxEvents () {
170-
if (this.editable && !this.$q.platform.is.mobile && this.dragOnlyRange !== true) {
170+
if (this.editable === true && this.$q.platform.is.mobile !== true && this.dragOnlyRange !== true) {
171171
return {
172172
focus: () => { this.__focus('max') },
173173
blur: this.__blur,
@@ -468,7 +468,7 @@ export default Vue.extend({
468468
},
469469
class: this.classes,
470470
on: this.events,
471-
directives: this.editable ? cache(this, 'dir', [{
471+
directives: this.editable === true ? cache(this, 'dir', [{
472472
name: 'touch-pan',
473473
value: this.__pan,
474474
modifiers: {

ui/src/components/rating/QRating.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default Vue.extend({
4242

4343
computed: {
4444
editable () {
45-
return !this.readonly && !this.disable
45+
return this.readonly !== true && this.disable !== true
4646
},
4747

4848
classes () {
@@ -53,8 +53,8 @@ export default Vue.extend({
5353

5454
iconData () {
5555
const
56-
len = Array.isArray(this.icon) ? this.icon.length : 0,
57-
selectedLen = Array.isArray(this.iconSelected) ? this.iconSelected.length : 0
56+
len = Array.isArray(this.icon) === true ? this.icon.length : 0,
57+
selectedLen = Array.isArray(this.iconSelected) === true ? this.iconSelected.length : 0
5858

5959
return {
6060
len,
@@ -132,10 +132,10 @@ export default Vue.extend({
132132
props: { name: name || this.$q.iconSet.rating.icon },
133133
attrs: { tabindex },
134134
on: cache(this, 'ico#' + i, {
135-
click: () => this.__set(i),
136-
mouseover: () => this.__setHoverValue(i),
135+
click: () => { this.__set(i) },
136+
mouseover: () => { this.__setHoverValue(i) },
137137
mouseout: () => { this.mouseModel = 0 },
138-
focus: () => this.__setHoverValue(i),
138+
focus: () => { this.__setHoverValue(i) },
139139
blur: () => { this.mouseModel = 0 },
140140
keyup: e => { this.__keyup(e, i) }
141141
})

ui/src/components/slider/QSlider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export default Vue.extend({
169169
},
170170
class: this.classes,
171171
on: this.events,
172-
directives: this.editable ? cache(this, 'dir', [{
172+
directives: this.editable === true ? cache(this, 'dir', [{
173173
name: 'touch-pan',
174174
value: this.__pan,
175175
modifiers: {

0 commit comments

Comments
 (0)