Skip to content

Commit a73dc70

Browse files
committed
feat: Final build for v0.6.0
1 parent 5ede238 commit a73dc70

File tree

8 files changed

+51
-107
lines changed

8 files changed

+51
-107
lines changed

build/script.dev.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var
66
webpackConfig = require('./webpack.dev.config'),
77
platform = require('./platform'),
88
app = express(),
9+
port = process.env.PORT || 8080,
910
compiler = webpack(webpackConfig),
1011
devMiddleware = require('webpack-dev-middleware')(compiler, {
1112
publicPath: '',
@@ -40,11 +41,11 @@ app.use('/statics', express.static('./dev/statics'))
4041
// try to serve Cordova statics for Play App
4142
app.use(express.static(platform.cordovaAssets))
4243

43-
module.exports = app.listen(8080, function (err) {
44+
module.exports = app.listen(port, function (err) {
4445
if (err) {
4546
console.log(err)
4647
return
4748
}
4849
console.log('Developing with "' + platform.theme + '" theme')
49-
console.log('Listening at http://localhost:8080\n')
50+
console.log('Listening at http://localhost:' + port + '\n')
5051
})

dev/views/dialog.vue

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<button class="primary" @click="radio()">Radio</button>
66
<button class="primary" @click="checkbox()">Checkbox</button>
77
<button class="primary" @click="checkbox(true)">Toggle</button>
8-
<button class="primary" @click="range()">Range</button>
98
<button class="primary" @click="progress()">Progress</button>
109
<button class="primary" @click="progress2()">Progress 2</button>
1110

@@ -251,46 +250,6 @@ export default {
251250
]
252251
253252
Dialog.create(options).show()
254-
},
255-
range () {
256-
Dialog.create({
257-
title: 'Ranges',
258-
ranges: [
259-
{
260-
label: 'Volume',
261-
min: 1,
262-
max: 5,
263-
iconMin: 'volume_down',
264-
iconMax: 'volume_up'
265-
},
266-
{
267-
label: 'Brightness',
268-
min: 1,
269-
max: 5,
270-
value: 2
271-
},
272-
{
273-
label: 'Speed',
274-
min: 1,
275-
max: 10,
276-
value: 6
277-
},
278-
{
279-
label: 'Noise Level',
280-
min: 4,
281-
max: 15
282-
}
283-
],
284-
buttons: [
285-
'Cancel',
286-
{
287-
label: 'Change',
288-
handler (data) {
289-
console.log('OK!', data)
290-
}
291-
}
292-
]
293-
}).show()
294253
}
295254
}
296255
}

src/components/action-sheet/action-sheet.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ function create (data) {
5959
.css(getCSS())
6060
.set({
6161
transitionIn: {translateY: [0, '101%']},
62-
transitionOut: {translateY: ['101%', 0]}
62+
transitionOut: {translateY: ['101%', 0]},
63+
onBackButton: data.dismissButton.handler
6364
})
6465

6566
modal.$el.classList.remove('items-center')

src/components/dialog/dialog.html

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,6 @@
3939
</div>
4040
</label>
4141
</div>
42-
<div v-if="ranges" class="modal-controls modal-scroll list">
43-
<template v-for="range in ranges">
44-
<div v-if="range.label" class="list-header">{{{* range.label}}}: {{range.value}}</div>
45-
<div class="item">
46-
<i v-if="range.iconMin" class="item-right-margin">{{* range.iconMin}}</i>
47-
<div v-else class="item-right-margin">{{* range.min}}</div>
48-
49-
<quasar-range :model.sync="range.value" :min.once="range.min" :max.once="range.max"></quasar-range>
50-
51-
<i v-if="range.iconMax" class="item-left-margin">{{* range.iconMax}}</i>
52-
<div v-else class="item-left-margin">{{* range.max}}</div>
53-
</div>
54-
</template>
55-
</div>
5642
<div v-if="progress" class="modal-slim-body">
5743
<quasar-progress
5844
:model="progress.model"

src/components/dialog/dialog.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,6 @@ function parseCheckboxes (checkboxes) {
8080
})
8181
}
8282

83-
function parseRanges (ranges) {
84-
if (!Array.isArray(ranges)) {
85-
throw new Error('Dialog ranges parameter must be an array.')
86-
}
87-
88-
if (ranges.some(
89-
range => typeof range.min === 'undefined' || typeof range.max === 'undefined'
90-
)) {
91-
throw new Error('One of Dialog\'s range parameter is missing either min or max')
92-
}
93-
94-
return ranges.map(range => {
95-
range.value = range.value || range.min
96-
return range
97-
})
98-
}
99-
10083
function parseProgress (progress) {
10184
if (progress !== Object(progress)) {
10285
throw new Error('Progress property is not an Object.')
@@ -131,9 +114,6 @@ function create (options) {
131114
else if (data.toggles) {
132115
data.toggles = parseCheckboxes(data.toggles)
133116
}
134-
else if (data.ranges) {
135-
data.ranges = parseRanges(data.ranges)
136-
}
137117
else if (data.progress) {
138118
data.progress = parseProgress(data.progress)
139119
}
@@ -159,14 +139,6 @@ function create (options) {
159139
checkbox => checkbox.checked
160140
).map(checkbox => checkbox.value)
161141
}
162-
if (this.ranges) {
163-
return this.ranges.map(range => {
164-
return {
165-
label: range.label,
166-
value: range.value
167-
}
168-
})
169-
}
170142
if (this.progress && !this.progress.indeterminate) {
171143
return this.progress.model
172144
}

src/components/modal/modal.js

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Utils from '../../utils'
2+
import Platform from '../../platform'
23
import { Vue } from '../../install'
34
import { current as theme } from '../../theme'
45

@@ -111,6 +112,7 @@ class Modal {
111112

112113
this.__popstate = () => {
113114
if (
115+
!Platform.within.iframe &&
114116
window.history.state &&
115117
window.history.state.modalId &&
116118
window.history.state.modalId >= this.__modalId
@@ -129,8 +131,11 @@ class Modal {
129131
if (this.selfDestroy) {
130132
this.destroy()
131133
}
134+
if (this.__closedByBackButton && this.onBackButton) {
135+
this.onBackButton()
136+
}
132137
this.__onCloseHandlers.forEach(
133-
handler => { console.log('onCloseHandler'); handler() }
138+
handler => { handler() }
134139
)
135140
if (typeof this.__onClose === 'function') {
136141
this.__onClose()
@@ -153,12 +158,17 @@ class Modal {
153158
if (this.__customElement) {
154159
this.$backdrop.removeEventListener('click', this.close)
155160
}
156-
window.removeEventListener('popstate', this.__popstate)
161+
if (!Platform.within.iframe) {
162+
window.removeEventListener('popstate', this.__popstate)
163+
}
157164
Velocity(this.$content, effect, options)
158165
}
159166
this.__modalId = ++openedModalNumber
160-
window.history.pushState({modalId: this.__modalId}, '')
161-
window.addEventListener('popstate', this.__popstate)
167+
this.__closedByBackButton = true
168+
if (!Platform.within.iframe) {
169+
window.history.pushState({modalId: this.__modalId}, '')
170+
window.addEventListener('popstate', this.__popstate)
171+
}
162172

163173
// finally show it
164174
Velocity(this.$content, effect, options)
@@ -168,21 +178,27 @@ class Modal {
168178

169179
close (onClose) {
170180
this.__onClose = onClose
171-
window.history.go(-1)
181+
this.__closedByBackButton = false
182+
if (Platform.within.iframe) {
183+
this.__popstate()
184+
}
185+
else {
186+
window.history.go(-1)
187+
}
172188
return this
173189
}
174190

175191
onShow (handler) {
176-
this.__trigger('onShow', handler)
192+
this.__registerTrigger('onShow', handler)
177193
return this
178194
}
179195

180196
onClose (handler) {
181-
this.__trigger('onClose', handler)
197+
this.__registerTrigger('onClose', handler)
182198
return this
183199
}
184200

185-
__trigger (event, handler) {
201+
__registerTrigger (event, handler) {
186202
if (typeof handler !== 'function') {
187203
throw new Error('Modal ' + event + ' handler must be a function.')
188204
}

src/themes/core/colors.styl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,14 @@ $blue-grey-14 = #455a64
306306

307307

308308
$colors ?= {
309-
primary: $primary
310-
secondary: $secondary
311-
tertiary: $tertiary
312-
positive: $positive
313-
negative: $negative
314-
warning: $warning
315-
info: $info
316-
light: $light
309+
primary: $primary,
310+
secondary: $secondary,
311+
tertiary: $tertiary,
312+
positive: $positive,
313+
negative: $negative,
314+
warning: $warning,
315+
info: $info,
316+
light: $light,
317317
dark: $dark,
318318
white: $white,
319319

src/vue-components/slider/slider.vue

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
</template>
4747

4848
<script>
49+
import Platform from '../../platform'
50+
4951
export default {
5052
props: {
5153
arrows: {
@@ -123,19 +125,26 @@ export default {
123125
},
124126
toggleFullscreen () {
125127
if (this.inFullscreen) {
126-
window.history.go(-1)
128+
if (Platform.within.iframe) {
129+
this.inFullscreen = false
130+
}
131+
else {
132+
window.history.go(-1)
133+
}
127134
return
128135
}
129136
130137
this.inFullscreen = true
131-
window.history.pushState({}, '')
132-
window.addEventListener('popstate', this.popState)
138+
if (!Platform.within.iframe) {
139+
window.history.pushState({}, '')
140+
window.addEventListener('popstate', this.__popState)
141+
}
133142
},
134-
popState () {
143+
__popState () {
135144
if (this.inFullscreen) {
136145
this.inFullscreen = false
137146
}
138-
window.removeEventListener('popstate', this.popState)
147+
window.removeEventListener('popstate', this.__popState)
139148
}
140149
},
141150
ready () {

0 commit comments

Comments
 (0)