mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-12-08 20:48:46 +00:00
Fixed focusing issue
This commit is contained in:
@@ -8,7 +8,10 @@
|
|||||||
<demo-size-modal/>
|
<demo-size-modal/>
|
||||||
|
|
||||||
<v-dialog
|
<v-dialog
|
||||||
@opened="onEveryDialogOpen"/>
|
@before-opened="dialogEvent('before-open')"
|
||||||
|
@before-closed="dialogEvent('before-close')"
|
||||||
|
@opened="dialogEvent('opened')"
|
||||||
|
@closed="dialogEvent('closed')"/>
|
||||||
|
|
||||||
<modal name="example-modal"
|
<modal name="example-modal"
|
||||||
transition="nice-modal-fade"
|
transition="nice-modal-fade"
|
||||||
@@ -185,6 +188,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'LIKE',
|
title: 'LIKE',
|
||||||
|
default: true,
|
||||||
handler: () => {
|
handler: () => {
|
||||||
alert('LIKE LIKE LIKE')
|
alert('LIKE LIKE LIKE')
|
||||||
}
|
}
|
||||||
@@ -199,8 +203,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onEveryDialogOpen () {
|
dialogEvent (eventName) {
|
||||||
console.log('Opened dialog')
|
console.log('Dialog event: ' + eventName)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
36
dist/index.js
vendored
36
dist/index.js
vendored
@@ -207,7 +207,7 @@
|
|||||||
}, function(module, exports, __webpack_require__) {
|
}, function(module, exports, __webpack_require__) {
|
||||||
__webpack_require__(18);
|
__webpack_require__(18);
|
||||||
var Component = __webpack_require__(1)(__webpack_require__(7), __webpack_require__(15), null, null);
|
var Component = __webpack_require__(1)(__webpack_require__(7), __webpack_require__(15), null, null);
|
||||||
Component.options.__file = "/Users/admin/Projects/vue/vue-js-modal/src/Dialog.vue",
|
Component.options.__file = "/Users/yev.vlasenko2/Projects/vue/vue-js-modal/src/Dialog.vue",
|
||||||
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
||||||
return "default" !== key && "__esModule" !== key;
|
return "default" !== key && "__esModule" !== key;
|
||||||
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Dialog.vue: functional components are not supported with templates, they should use render functions."),
|
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Dialog.vue: functional components are not supported with templates, they should use render functions."),
|
||||||
@@ -215,7 +215,7 @@
|
|||||||
}, function(module, exports, __webpack_require__) {
|
}, function(module, exports, __webpack_require__) {
|
||||||
__webpack_require__(19);
|
__webpack_require__(19);
|
||||||
var Component = __webpack_require__(1)(__webpack_require__(8), __webpack_require__(16), null, null);
|
var Component = __webpack_require__(1)(__webpack_require__(8), __webpack_require__(16), null, null);
|
||||||
Component.options.__file = "/Users/admin/Projects/vue/vue-js-modal/src/Modal.vue",
|
Component.options.__file = "/Users/yev.vlasenko2/Projects/vue/vue-js-modal/src/Modal.vue",
|
||||||
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
||||||
return "default" !== key && "__esModule" !== key;
|
return "default" !== key && "__esModule" !== key;
|
||||||
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Modal.vue: functional components are not supported with templates, they should use render functions."),
|
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Modal.vue: functional components are not supported with templates, they should use render functions."),
|
||||||
@@ -260,15 +260,25 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
beforeOpened: function(event) {
|
beforeOpened: function(event) {
|
||||||
this.params = event.params || {}, this.$emit("before-opened", event);
|
window.addEventListener("keyup", this.onKeyUp), this.params = event.params || {},
|
||||||
|
this.$emit("before-opened", event);
|
||||||
},
|
},
|
||||||
beforeClosed: function(event) {
|
beforeClosed: function(event) {
|
||||||
this.params = {}, this.$emit("before-closed", event);
|
window.removeEventListener("keyup", this.onKeyUp), this.params = {}, this.$emit("before-closed", event);
|
||||||
},
|
},
|
||||||
click: function(i, event) {
|
click: function(i, event) {
|
||||||
var button = this.buttons[i];
|
var source = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "click", button = this.buttons[i];
|
||||||
if ("function" == typeof button.handler) return button.handler(i, event);
|
button && "function" == typeof button.handler ? button.handler(i, event, {
|
||||||
this.$modal.hide("dialog");
|
source: source
|
||||||
|
}) : this.$modal.hide("dialog");
|
||||||
|
},
|
||||||
|
onKeyUp: function(event) {
|
||||||
|
if (13 === event.which && this.buttons.length > 0) {
|
||||||
|
var buttonIndex = 1 === this.buttons.length ? 0 : this.buttons.findIndex(function(button) {
|
||||||
|
return button.default;
|
||||||
|
});
|
||||||
|
-1 !== buttonIndex && this.click(buttonIndex, event, "keypress");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -490,7 +500,7 @@
|
|||||||
modal.heightType = height.type;
|
modal.heightType = height.type;
|
||||||
},
|
},
|
||||||
onEscapeKeyUp: function(event) {
|
onEscapeKeyUp: function(event) {
|
||||||
27 === (event.keyCode || event.which) && this.visible && this.$modal.hide(this.name);
|
27 === event.which && this.visible && this.$modal.hide(this.name);
|
||||||
},
|
},
|
||||||
onWindowResize: function() {
|
onWindowResize: function() {
|
||||||
this.window.width = window.innerWidth, this.window.height = window.innerHeight;
|
this.window.width = window.innerWidth, this.window.height = window.innerHeight;
|
||||||
@@ -514,8 +524,8 @@
|
|||||||
},
|
},
|
||||||
toggle: function(state, params) {
|
toggle: function(state, params) {
|
||||||
var reset = this.reset, scrollable = this.scrollable, visible = this.visible, beforeEventName = visible ? "before-close" : "before-open";
|
var reset = this.reset, scrollable = this.scrollable, visible = this.visible, beforeEventName = visible ? "before-close" : "before-open";
|
||||||
"before-open" === beforeEventName ? (reset && (this.setInitialSize(), this.shift.left = 0,
|
"before-open" === beforeEventName ? (document.activeElement && document.activeElement.blur(),
|
||||||
this.shift.top = 0), scrollable && document.body.classList.add("v--modal-block-scroll")) : scrollable && document.body.classList.remove("v--modal-block-scroll");
|
reset && (this.setInitialSize(), this.shift.left = 0, this.shift.top = 0), scrollable && document.body.classList.add("v--modal-block-scroll")) : scrollable && document.body.classList.remove("v--modal-block-scroll");
|
||||||
var stopEventExecution = !1, stop = function() {
|
var stopEventExecution = !1, stop = function() {
|
||||||
stopEventExecution = !0;
|
stopEventExecution = !0;
|
||||||
}, beforeEvent = this.genEventObject({
|
}, beforeEvent = this.genEventObject({
|
||||||
@@ -566,10 +576,10 @@
|
|||||||
removeDraggableListeners: function() {},
|
removeDraggableListeners: function() {},
|
||||||
callAfterEvent: function(state) {
|
callAfterEvent: function(state) {
|
||||||
state ? this.connectObserver() : this.disconnectObserver();
|
state ? this.connectObserver() : this.disconnectObserver();
|
||||||
var afterEventName = state ? "opened" : "closed", afterEvent = this.genEventObject({
|
var eventName = state ? "opened" : "closed", event = this.genEventObject({
|
||||||
state: state
|
state: state
|
||||||
});
|
});
|
||||||
this.$emit(afterEventName, afterEvent);
|
this.$emit(eventName, event);
|
||||||
},
|
},
|
||||||
updateRenderedHeight: function() {
|
updateRenderedHeight: function() {
|
||||||
this.$refs.modal && (this.modal.renderedHeight = this.$refs.modal.getBoundingClientRect().height);
|
this.$refs.modal && (this.modal.renderedHeight = this.$refs.modal.getBoundingClientRect().height);
|
||||||
@@ -714,7 +724,7 @@
|
|||||||
}, function(module, exports, __webpack_require__) {
|
}, function(module, exports, __webpack_require__) {
|
||||||
__webpack_require__(20);
|
__webpack_require__(20);
|
||||||
var Component = __webpack_require__(1)(__webpack_require__(9), __webpack_require__(17), null, null);
|
var Component = __webpack_require__(1)(__webpack_require__(9), __webpack_require__(17), null, null);
|
||||||
Component.options.__file = "/Users/admin/Projects/vue/vue-js-modal/src/Resizer.vue",
|
Component.options.__file = "/Users/yev.vlasenko2/Projects/vue/vue-js-modal/src/Resizer.vue",
|
||||||
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
||||||
return "default" !== key && "__esModule" !== key;
|
return "default" !== key && "__esModule" !== key;
|
||||||
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Resizer.vue: functional components are not supported with templates, they should use render functions."),
|
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Resizer.vue: functional components are not supported with templates, they should use render functions."),
|
||||||
|
|||||||
36
dist/ssr.index.js
vendored
36
dist/ssr.index.js
vendored
@@ -161,7 +161,7 @@
|
|||||||
}, function(module, exports, __webpack_require__) {
|
}, function(module, exports, __webpack_require__) {
|
||||||
__webpack_require__(18);
|
__webpack_require__(18);
|
||||||
var Component = __webpack_require__(1)(__webpack_require__(7), __webpack_require__(15), null, null);
|
var Component = __webpack_require__(1)(__webpack_require__(7), __webpack_require__(15), null, null);
|
||||||
Component.options.__file = "/Users/admin/Projects/vue/vue-js-modal/src/Dialog.vue",
|
Component.options.__file = "/Users/yev.vlasenko2/Projects/vue/vue-js-modal/src/Dialog.vue",
|
||||||
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
||||||
return "default" !== key && "__esModule" !== key;
|
return "default" !== key && "__esModule" !== key;
|
||||||
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Dialog.vue: functional components are not supported with templates, they should use render functions."),
|
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Dialog.vue: functional components are not supported with templates, they should use render functions."),
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
}, function(module, exports, __webpack_require__) {
|
}, function(module, exports, __webpack_require__) {
|
||||||
__webpack_require__(19);
|
__webpack_require__(19);
|
||||||
var Component = __webpack_require__(1)(__webpack_require__(8), __webpack_require__(16), null, null);
|
var Component = __webpack_require__(1)(__webpack_require__(8), __webpack_require__(16), null, null);
|
||||||
Component.options.__file = "/Users/admin/Projects/vue/vue-js-modal/src/Modal.vue",
|
Component.options.__file = "/Users/yev.vlasenko2/Projects/vue/vue-js-modal/src/Modal.vue",
|
||||||
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
||||||
return "default" !== key && "__esModule" !== key;
|
return "default" !== key && "__esModule" !== key;
|
||||||
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Modal.vue: functional components are not supported with templates, they should use render functions."),
|
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Modal.vue: functional components are not supported with templates, they should use render functions."),
|
||||||
@@ -214,15 +214,25 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
beforeOpened: function(event) {
|
beforeOpened: function(event) {
|
||||||
this.params = event.params || {}, this.$emit("before-opened", event);
|
window.addEventListener("keyup", this.onKeyUp), this.params = event.params || {},
|
||||||
|
this.$emit("before-opened", event);
|
||||||
},
|
},
|
||||||
beforeClosed: function(event) {
|
beforeClosed: function(event) {
|
||||||
this.params = {}, this.$emit("before-closed", event);
|
window.removeEventListener("keyup", this.onKeyUp), this.params = {}, this.$emit("before-closed", event);
|
||||||
},
|
},
|
||||||
click: function(i, event) {
|
click: function(i, event) {
|
||||||
var button = this.buttons[i];
|
var source = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "click", button = this.buttons[i];
|
||||||
if ("function" == typeof button.handler) return button.handler(i, event);
|
button && "function" == typeof button.handler ? button.handler(i, event, {
|
||||||
this.$modal.hide("dialog");
|
source: source
|
||||||
|
}) : this.$modal.hide("dialog");
|
||||||
|
},
|
||||||
|
onKeyUp: function(event) {
|
||||||
|
if (13 === event.which && this.buttons.length > 0) {
|
||||||
|
var buttonIndex = 1 === this.buttons.length ? 0 : this.buttons.findIndex(function(button) {
|
||||||
|
return button.default;
|
||||||
|
});
|
||||||
|
-1 !== buttonIndex && this.click(buttonIndex, event, "keypress");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -444,7 +454,7 @@
|
|||||||
modal.heightType = height.type;
|
modal.heightType = height.type;
|
||||||
},
|
},
|
||||||
onEscapeKeyUp: function(event) {
|
onEscapeKeyUp: function(event) {
|
||||||
27 === (event.keyCode || event.which) && this.visible && this.$modal.hide(this.name);
|
27 === event.which && this.visible && this.$modal.hide(this.name);
|
||||||
},
|
},
|
||||||
onWindowResize: function() {
|
onWindowResize: function() {
|
||||||
this.window.width = window.innerWidth, this.window.height = window.innerHeight;
|
this.window.width = window.innerWidth, this.window.height = window.innerHeight;
|
||||||
@@ -468,8 +478,8 @@
|
|||||||
},
|
},
|
||||||
toggle: function(state, params) {
|
toggle: function(state, params) {
|
||||||
var reset = this.reset, scrollable = this.scrollable, visible = this.visible, beforeEventName = visible ? "before-close" : "before-open";
|
var reset = this.reset, scrollable = this.scrollable, visible = this.visible, beforeEventName = visible ? "before-close" : "before-open";
|
||||||
"before-open" === beforeEventName ? (reset && (this.setInitialSize(), this.shift.left = 0,
|
"before-open" === beforeEventName ? (document.activeElement && document.activeElement.blur(),
|
||||||
this.shift.top = 0), scrollable && document.body.classList.add("v--modal-block-scroll")) : scrollable && document.body.classList.remove("v--modal-block-scroll");
|
reset && (this.setInitialSize(), this.shift.left = 0, this.shift.top = 0), scrollable && document.body.classList.add("v--modal-block-scroll")) : scrollable && document.body.classList.remove("v--modal-block-scroll");
|
||||||
var stopEventExecution = !1, stop = function() {
|
var stopEventExecution = !1, stop = function() {
|
||||||
stopEventExecution = !0;
|
stopEventExecution = !0;
|
||||||
}, beforeEvent = this.genEventObject({
|
}, beforeEvent = this.genEventObject({
|
||||||
@@ -520,10 +530,10 @@
|
|||||||
removeDraggableListeners: function() {},
|
removeDraggableListeners: function() {},
|
||||||
callAfterEvent: function(state) {
|
callAfterEvent: function(state) {
|
||||||
state ? this.connectObserver() : this.disconnectObserver();
|
state ? this.connectObserver() : this.disconnectObserver();
|
||||||
var afterEventName = state ? "opened" : "closed", afterEvent = this.genEventObject({
|
var eventName = state ? "opened" : "closed", event = this.genEventObject({
|
||||||
state: state
|
state: state
|
||||||
});
|
});
|
||||||
this.$emit(afterEventName, afterEvent);
|
this.$emit(eventName, event);
|
||||||
},
|
},
|
||||||
updateRenderedHeight: function() {
|
updateRenderedHeight: function() {
|
||||||
this.$refs.modal && (this.modal.renderedHeight = this.$refs.modal.getBoundingClientRect().height);
|
this.$refs.modal && (this.modal.renderedHeight = this.$refs.modal.getBoundingClientRect().height);
|
||||||
@@ -668,7 +678,7 @@
|
|||||||
}, function(module, exports, __webpack_require__) {
|
}, function(module, exports, __webpack_require__) {
|
||||||
__webpack_require__(20);
|
__webpack_require__(20);
|
||||||
var Component = __webpack_require__(1)(__webpack_require__(9), __webpack_require__(17), null, null);
|
var Component = __webpack_require__(1)(__webpack_require__(9), __webpack_require__(17), null, null);
|
||||||
Component.options.__file = "/Users/admin/Projects/vue/vue-js-modal/src/Resizer.vue",
|
Component.options.__file = "/Users/yev.vlasenko2/Projects/vue/vue-js-modal/src/Resizer.vue",
|
||||||
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
Component.esModule && Object.keys(Component.esModule).some(function(key) {
|
||||||
return "default" !== key && "__esModule" !== key;
|
return "default" !== key && "__esModule" !== key;
|
||||||
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Resizer.vue: functional components are not supported with templates, they should use render functions."),
|
}) && console.error("named exports are not supported in *.vue files."), Component.options.functional && console.error("[vue-loader] Resizer.vue: functional components are not supported with templates, they should use render functions."),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-js-modal",
|
"name": "vue-js-modal",
|
||||||
"description": "Modal Component for Vue.js",
|
"description": "Modal Component for Vue.js",
|
||||||
"version": "1.3.5",
|
"version": "1.3.6",
|
||||||
"author": "euvl <yev.vlasenko@gmail.com>",
|
"author": "euvl <yev.vlasenko@gmail.com>",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal name="dialog"
|
<modal
|
||||||
|
name="dialog"
|
||||||
height="auto"
|
height="auto"
|
||||||
:classes="['v--modal', 'vue-dialog', this.params.class]"
|
:classes="['v--modal', 'vue-dialog', this.params.class]"
|
||||||
:width="width"
|
:width="width"
|
||||||
@@ -7,20 +8,24 @@
|
|||||||
:adaptive="true"
|
:adaptive="true"
|
||||||
:clickToClose="clickToClose"
|
:clickToClose="clickToClose"
|
||||||
:transition="transition"
|
:transition="transition"
|
||||||
@keyup.enter="clickDefault"
|
|
||||||
@before-open="beforeOpened"
|
@before-open="beforeOpened"
|
||||||
@before-close="beforeClosed"
|
@before-close="beforeClosed"
|
||||||
@opened="$emit('opened', $event)"
|
@opened="$emit('opened', $event)"
|
||||||
@closed="$emit('closed', $event)">
|
@closed="$emit('closed', $event)">
|
||||||
<div class="dialog-content">
|
<div class="dialog-content">
|
||||||
<div class="dialog-c-title"
|
<div
|
||||||
|
class="dialog-c-title"
|
||||||
v-if="params.title"
|
v-if="params.title"
|
||||||
v-html="params.title || ''"></div>
|
v-html="params.title || ''"></div>
|
||||||
<div class="dialog-c-text"
|
<div
|
||||||
|
class="dialog-c-text"
|
||||||
v-html="params.text || ''"></div>
|
v-html="params.text || ''"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="vue-dialog-buttons" v-if="buttons">
|
<div
|
||||||
<button v-for="(button, i) in buttons"
|
class="vue-dialog-buttons"
|
||||||
|
v-if="buttons">
|
||||||
|
<button
|
||||||
|
v-for="(button, i) in buttons"
|
||||||
:class="button.class || 'vue-dialog-button'"
|
:class="button.class || 'vue-dialog-button'"
|
||||||
:style="buttonStyle"
|
:style="buttonStyle"
|
||||||
:key="i"
|
:key="i"
|
||||||
@@ -71,41 +76,34 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
beforeOpened (event) {
|
beforeOpened (event) {
|
||||||
|
window.addEventListener('keyup', this.onKeyUp)
|
||||||
|
|
||||||
this.params = event.params || {}
|
this.params = event.params || {}
|
||||||
this.$emit('before-opened', event)
|
this.$emit('before-opened', event)
|
||||||
},
|
},
|
||||||
beforeClosed (event) {
|
beforeClosed (event) {
|
||||||
|
window.removeEventListener('keyup', this.onKeyUp)
|
||||||
|
|
||||||
this.params = {}
|
this.params = {}
|
||||||
this.$emit('before-closed', event)
|
this.$emit('before-closed', event)
|
||||||
},
|
},
|
||||||
click (i, event) {
|
click (i, event, source = 'click') {
|
||||||
let button = this.buttons[i]
|
const button = this.buttons[i]
|
||||||
|
|
||||||
if (typeof button.handler === 'function') {
|
if (button && typeof button.handler === 'function') {
|
||||||
return button.handler(i, event)
|
button.handler(i, event, { source })
|
||||||
} else {
|
} else {
|
||||||
this.$modal.hide('dialog')
|
this.$modal.hide('dialog')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clickDefault () {
|
onKeyUp (event) {
|
||||||
if(this.buttons === undefined || !this.buttons) {
|
if (event.which === 13 && this.buttons.length > 0) {
|
||||||
this.$modal.hide('dialog')
|
const buttonIndex = this.buttons.length === 1
|
||||||
}
|
? 0
|
||||||
if(this.buttons.length > 1) {
|
: this.buttons.findIndex(button => button.default)
|
||||||
return this.buttons.map(button => {
|
|
||||||
if(button.default != undefined && button.default == true) {
|
if (buttonIndex !== -1) {
|
||||||
if (typeof button.handler === 'function') {
|
this.click(buttonIndex, event, 'keypress')
|
||||||
return button.handler()
|
|
||||||
} else {
|
|
||||||
this.$modal.hide('dialog')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if(this.buttons.length == 1) {
|
|
||||||
if (typeof this.buttons[0].handler === 'function') {
|
|
||||||
return this.buttons[0].handler()
|
|
||||||
} else {
|
|
||||||
this.$modal.hide('dialog')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,7 +130,6 @@
|
|||||||
.vue-dialog .dialog-c-title {
|
.vue-dialog .dialog-c-title {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
padding-bottom: 15px;
|
padding-bottom: 15px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.vue-dialog .dialog-c-text {
|
.vue-dialog .dialog-c-text {
|
||||||
|
|||||||
@@ -258,7 +258,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.clickToClose) {
|
if (this.clickToClose) {
|
||||||
// window.addEventListener('keyup', this.onEscapeKeyUp)
|
window.addEventListener('keyup', this.onEscapeKeyUp)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@@ -268,7 +268,7 @@
|
|||||||
window.removeEventListener('resize', this.onWindowResize)
|
window.removeEventListener('resize', this.onWindowResize)
|
||||||
|
|
||||||
if (this.clickToClose) {
|
if (this.clickToClose) {
|
||||||
// window.removeEventListener('keyup', this.onEscapeKeyUp)
|
window.removeEventListener('keyup', this.onEscapeKeyUp)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -381,9 +381,9 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onEscapeKeyUp (event) {
|
onEscapeKeyUp (event) {
|
||||||
// if (event.which === 27 && this.visible) {
|
if (event.which === 27 && this.visible) {
|
||||||
// this.$modal.hide(this.name)
|
this.$modal.hide(this.name)
|
||||||
// }
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onWindowResize () {
|
onWindowResize () {
|
||||||
@@ -427,8 +427,6 @@
|
|||||||
toggle (state, params) {
|
toggle (state, params) {
|
||||||
const { reset, scrollable, visible } = this
|
const { reset, scrollable, visible } = this
|
||||||
|
|
||||||
console.log('woot')
|
|
||||||
|
|
||||||
const beforeEventName = visible
|
const beforeEventName = visible
|
||||||
? 'before-close'
|
? 'before-close'
|
||||||
: 'before-open'
|
: 'before-open'
|
||||||
@@ -441,6 +439,7 @@
|
|||||||
if (document.activeElement) {
|
if (document.activeElement) {
|
||||||
document.activeElement.blur()
|
document.activeElement.blur()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reset) {
|
if (reset) {
|
||||||
this.setInitialSize()
|
this.setInitialSize()
|
||||||
|
|
||||||
@@ -577,12 +576,10 @@
|
|||||||
this.disconnectObserver()
|
this.disconnectObserver()
|
||||||
}
|
}
|
||||||
|
|
||||||
const afterEventName = state
|
const eventName = state ? 'opened' : 'closed'
|
||||||
? 'opened'
|
const event = this.genEventObject({ state })
|
||||||
: 'closed'
|
|
||||||
const afterEvent = this.genEventObject({ state })
|
|
||||||
|
|
||||||
this.$emit(afterEventName, afterEvent)
|
this.$emit(eventName, event)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user