Added event parameter,
This commit is contained in:
+7
-3
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user