Skip to content

Override closeButton event handler #58

Description

@Taantawan

What I want to achieve is to hide window and keep the frame object when the close button is clicked, and make it possible to show the same window with frame.show().

I could not realize it with using only JSFrame interface or options and API. I tried setControl() etc, but no vail.

So I had to do workaround like below. (It uses JQuery but it is not substantial.)

Appreciate it if you show me how to do the same in a more proper manner.

let oJsFrame = new JSFrame();
oFrame = oJsFrame.create({`
        title: 'Create Account Confirmation',
	left: window.innerWidth / 2 - window.innerWidth / 4,
	top: window.innerHeight / 2 - window.innerHeight / 4,
	width: window.innerWidth / 2,
	height: window.innerHeight / 2,
	movable: true,
	resizable: true,
	html: "<div id=registration-popup>Something here</div>"
});

$("[component-id=closeButton]").unbind("click");
$("[component-id=closeButton]").attr("onclick", "");
oFrame.on("closeButton", "click", (_frame, _evt) => {
	oFrame.hide();
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions