diff --git a/build/script.dev.js b/build/script.dev.js
index 5a240483e41..dbb7ffa7532 100644
--- a/build/script.dev.js
+++ b/build/script.dev.js
@@ -6,6 +6,7 @@ var
webpackConfig = require('./webpack.dev.config'),
platform = require('./platform'),
app = express(),
+ port = process.env.PORT || 8080,
compiler = webpack(webpackConfig),
devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: '',
@@ -40,11 +41,11 @@ app.use('/statics', express.static('./dev/statics'))
// try to serve Cordova statics for Play App
app.use(express.static(platform.cordovaAssets))
-module.exports = app.listen(8080, function (err) {
+module.exports = app.listen(port, function (err) {
if (err) {
console.log(err)
return
}
console.log('Developing with "' + platform.theme + '" theme')
- console.log('Listening at http://localhost:8080\n')
+ console.log('Listening at http://localhost:' + port + '\n')
})
diff --git a/dev/views/dialog.vue b/dev/views/dialog.vue
index bd9bfa44daf..aef24bb5b50 100644
--- a/dev/views/dialog.vue
+++ b/dev/views/dialog.vue
@@ -5,7 +5,6 @@
-
@@ -251,46 +250,6 @@ export default {
]
Dialog.create(options).show()
- },
- range () {
- Dialog.create({
- title: 'Ranges',
- ranges: [
- {
- label: 'Volume',
- min: 1,
- max: 5,
- iconMin: 'volume_down',
- iconMax: 'volume_up'
- },
- {
- label: 'Brightness',
- min: 1,
- max: 5,
- value: 2
- },
- {
- label: 'Speed',
- min: 1,
- max: 10,
- value: 6
- },
- {
- label: 'Noise Level',
- min: 4,
- max: 15
- }
- ],
- buttons: [
- 'Cancel',
- {
- label: 'Change',
- handler (data) {
- console.log('OK!', data)
- }
- }
- ]
- }).show()
}
}
}
diff --git a/src/components/action-sheet/action-sheet.js b/src/components/action-sheet/action-sheet.js
index 1ddbbb88c6a..01a4e49bbe7 100644
--- a/src/components/action-sheet/action-sheet.js
+++ b/src/components/action-sheet/action-sheet.js
@@ -59,7 +59,8 @@ function create (data) {
.css(getCSS())
.set({
transitionIn: {translateY: [0, '101%']},
- transitionOut: {translateY: ['101%', 0]}
+ transitionOut: {translateY: ['101%', 0]},
+ onBackButton: data.dismissButton.handler
})
modal.$el.classList.remove('items-center')
diff --git a/src/components/dialog/dialog.html b/src/components/dialog/dialog.html
index 6c338aac337..67fa96dcbc8 100644
--- a/src/components/dialog/dialog.html
+++ b/src/components/dialog/dialog.html
@@ -39,20 +39,6 @@
-
typeof range.min === 'undefined' || typeof range.max === 'undefined'
- )) {
- throw new Error('One of Dialog\'s range parameter is missing either min or max')
- }
-
- return ranges.map(range => {
- range.value = range.value || range.min
- return range
- })
-}
-
function parseProgress (progress) {
if (progress !== Object(progress)) {
throw new Error('Progress property is not an Object.')
@@ -131,9 +114,6 @@ function create (options) {
else if (data.toggles) {
data.toggles = parseCheckboxes(data.toggles)
}
- else if (data.ranges) {
- data.ranges = parseRanges(data.ranges)
- }
else if (data.progress) {
data.progress = parseProgress(data.progress)
}
@@ -159,14 +139,6 @@ function create (options) {
checkbox => checkbox.checked
).map(checkbox => checkbox.value)
}
- if (this.ranges) {
- return this.ranges.map(range => {
- return {
- label: range.label,
- value: range.value
- }
- })
- }
if (this.progress && !this.progress.indeterminate) {
return this.progress.model
}
diff --git a/src/components/modal/modal.js b/src/components/modal/modal.js
index 49606bde1ce..bcbe9ec0222 100644
--- a/src/components/modal/modal.js
+++ b/src/components/modal/modal.js
@@ -1,4 +1,5 @@
import Utils from '../../utils'
+import Platform from '../../platform'
import { Vue } from '../../install'
import { current as theme } from '../../theme'
@@ -111,6 +112,7 @@ class Modal {
this.__popstate = () => {
if (
+ !Platform.within.iframe &&
window.history.state &&
window.history.state.modalId &&
window.history.state.modalId >= this.__modalId
@@ -129,8 +131,11 @@ class Modal {
if (this.selfDestroy) {
this.destroy()
}
+ if (this.__closedByBackButton && this.onBackButton) {
+ this.onBackButton()
+ }
this.__onCloseHandlers.forEach(
- handler => { console.log('onCloseHandler'); handler() }
+ handler => { handler() }
)
if (typeof this.__onClose === 'function') {
this.__onClose()
@@ -153,12 +158,17 @@ class Modal {
if (this.__customElement) {
this.$backdrop.removeEventListener('click', this.close)
}
- window.removeEventListener('popstate', this.__popstate)
+ if (!Platform.within.iframe) {
+ window.removeEventListener('popstate', this.__popstate)
+ }
Velocity(this.$content, effect, options)
}
this.__modalId = ++openedModalNumber
- window.history.pushState({modalId: this.__modalId}, '')
- window.addEventListener('popstate', this.__popstate)
+ this.__closedByBackButton = true
+ if (!Platform.within.iframe) {
+ window.history.pushState({modalId: this.__modalId}, '')
+ window.addEventListener('popstate', this.__popstate)
+ }
// finally show it
Velocity(this.$content, effect, options)
@@ -168,21 +178,27 @@ class Modal {
close (onClose) {
this.__onClose = onClose
- window.history.go(-1)
+ this.__closedByBackButton = false
+ if (Platform.within.iframe) {
+ this.__popstate()
+ }
+ else {
+ window.history.go(-1)
+ }
return this
}
onShow (handler) {
- this.__trigger('onShow', handler)
+ this.__registerTrigger('onShow', handler)
return this
}
onClose (handler) {
- this.__trigger('onClose', handler)
+ this.__registerTrigger('onClose', handler)
return this
}
- __trigger (event, handler) {
+ __registerTrigger (event, handler) {
if (typeof handler !== 'function') {
throw new Error('Modal ' + event + ' handler must be a function.')
}
diff --git a/src/themes/core/colors.styl b/src/themes/core/colors.styl
index 4951d40bcf7..c7c0af65ceb 100644
--- a/src/themes/core/colors.styl
+++ b/src/themes/core/colors.styl
@@ -306,14 +306,14 @@ $blue-grey-14 = #455a64
$colors ?= {
- primary: $primary
- secondary: $secondary
- tertiary: $tertiary
- positive: $positive
- negative: $negative
- warning: $warning
- info: $info
- light: $light
+ primary: $primary,
+ secondary: $secondary,
+ tertiary: $tertiary,
+ positive: $positive,
+ negative: $negative,
+ warning: $warning,
+ info: $info,
+ light: $light,
dark: $dark,
white: $white,
diff --git a/src/vue-components/slider/slider.vue b/src/vue-components/slider/slider.vue
index 694d0a2a0f9..9ce4a43d786 100644
--- a/src/vue-components/slider/slider.vue
+++ b/src/vue-components/slider/slider.vue
@@ -46,6 +46,8 @@