diff --git a/dist/index.js b/dist/index.js index 7861b22..d7d71aa 100644 --- a/dist/index.js +++ b/dist/index.js @@ -531,17 +531,20 @@ this.$emit("resize", resizeEvent); }, toggle: function(state, params) { - var reset = this.reset, scrollable = this.scrollable, visible = this.visible, beforeEventName = visible ? "before-close" : "before-open"; - "before-open" === beforeEventName ? (document.activeElement && document.activeElement.blur(), - 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() { - stopEventExecution = !0; - }, beforeEvent = this.genEventObject({ - stop: stop, - state: state, - params: params - }); - this.$emit(beforeEventName, beforeEvent), stopEventExecution || (this.visible = state); + var reset = this.reset, scrollable = this.scrollable, visible = this.visible; + if (visible !== state) { + var beforeEventName = visible ? "before-close" : "before-open"; + "before-open" === beforeEventName ? (document.activeElement && document.activeElement.blur(), + 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() { + stopEventExecution = !0; + }, beforeEvent = this.genEventObject({ + stop: stop, + state: state, + params: params + }); + this.$emit(beforeEventName, beforeEvent), stopEventExecution || (this.visible = state); + } }, getDraggableElement: function() { var selector = "string" != typeof this.draggable ? ".v--modal-box" : this.draggable; @@ -781,6 +784,9 @@ key: i, class: button.class || "vue-dialog-button", style: _vm.buttonStyle, + attrs: { + type: "button" + }, domProps: { innerHTML: _vm._s(button.title) }, diff --git a/dist/ssr.index.js b/dist/ssr.index.js index fd90ff1..4eeb526 100644 --- a/dist/ssr.index.js +++ b/dist/ssr.index.js @@ -485,17 +485,20 @@ this.$emit("resize", resizeEvent); }, toggle: function(state, params) { - var reset = this.reset, scrollable = this.scrollable, visible = this.visible, beforeEventName = visible ? "before-close" : "before-open"; - "before-open" === beforeEventName ? (document.activeElement && document.activeElement.blur(), - 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() { - stopEventExecution = !0; - }, beforeEvent = this.genEventObject({ - stop: stop, - state: state, - params: params - }); - this.$emit(beforeEventName, beforeEvent), stopEventExecution || (this.visible = state); + var reset = this.reset, scrollable = this.scrollable, visible = this.visible; + if (visible !== state) { + var beforeEventName = visible ? "before-close" : "before-open"; + "before-open" === beforeEventName ? (document.activeElement && document.activeElement.blur(), + 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() { + stopEventExecution = !0; + }, beforeEvent = this.genEventObject({ + stop: stop, + state: state, + params: params + }); + this.$emit(beforeEventName, beforeEvent), stopEventExecution || (this.visible = state); + } }, getDraggableElement: function() { var selector = "string" != typeof this.draggable ? ".v--modal-box" : this.draggable; @@ -735,6 +738,9 @@ key: i, class: button.class || "vue-dialog-button", style: _vm.buttonStyle, + attrs: { + type: "button" + }, domProps: { innerHTML: _vm._s(button.title) }, diff --git a/dist/ssr.nocss.js b/dist/ssr.nocss.js index ec83087..9210023 100644 --- a/dist/ssr.nocss.js +++ b/dist/ssr.nocss.js @@ -422,17 +422,20 @@ this.$emit("resize", resizeEvent); }, toggle: function(state, params) { - var reset = this.reset, scrollable = this.scrollable, visible = this.visible, beforeEventName = visible ? "before-close" : "before-open"; - "before-open" === beforeEventName ? (document.activeElement && document.activeElement.blur(), - 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() { - stopEventExecution = !0; - }, beforeEvent = this.genEventObject({ - stop: stop, - state: state, - params: params - }); - this.$emit(beforeEventName, beforeEvent), stopEventExecution || (this.visible = state); + var reset = this.reset, scrollable = this.scrollable, visible = this.visible; + if (visible !== state) { + var beforeEventName = visible ? "before-close" : "before-open"; + "before-open" === beforeEventName ? (document.activeElement && document.activeElement.blur(), + 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() { + stopEventExecution = !0; + }, beforeEvent = this.genEventObject({ + stop: stop, + state: state, + params: params + }); + this.$emit(beforeEventName, beforeEvent), stopEventExecution || (this.visible = state); + } }, getDraggableElement: function() { var selector = "string" != typeof this.draggable ? ".v--modal-box" : this.draggable; @@ -666,6 +669,9 @@ key: i, class: button.class || "vue-dialog-button", style: _vm.buttonStyle, + attrs: { + type: "button" + }, domProps: { innerHTML: _vm._s(button.title) },