Added event parameter,

This commit is contained in:
2019-08-01 19:30:07 +02:00
parent e72836e0f7
commit db2badfc0d
4 changed files with 37 additions and 23 deletions
+7 -3
View File
@@ -1,3 +1,6 @@
/* eslint-disable no-console */
/* eslint-disable no-case-declarations */
/* eslint-disable no-unused-vars */
import { Elements } from './utils.js'
import Poppable from './poppable.js'
@@ -182,6 +185,7 @@ export default class Popup extends Poppable {
}
for (let key in content) {
console.log('using', key, this.loaded)
switch (key) {
case 'selector':
break
@@ -293,7 +297,7 @@ export default class Popup extends Poppable {
handleClose(e) {
let closing = this.closingEvent(e)
if (closing) {
this.close()
this.close(e)
} else {
this.setupCloseHandler()
}
@@ -423,11 +427,11 @@ export default class Popup extends Poppable {
/** Close and remove the Popup from the DOM tree.
*/
close() {
close(event) {
//console.log("Popup.close", this.closeCommand)
this.unregister(this.context)
if (this.closeCommand) {
this.closeCommand(this, () => this.remove())
this.closeCommand(this, () => this.remove(), event)
} else {
this.remove()
}