Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Hide X/close button option on Dialogs #3886

Closed
bradorego opened this issue Mar 23, 2012 · 3 comments
Closed

Hide X/close button option on Dialogs #3886

bradorego opened this issue Mar 23, 2012 · 3 comments

Comments

@bradorego
Copy link

In a move toward a configurable "modal" native jqm dialog, there should be some way to hide the "X" button that appears on dialogs. I've hacked something together in my app to delete the button and to catch back-button events on specific pages, but I feel like this could be configurable (e.g. $.mobile.dialog.options.addBackBtn = false [default true]).

If we wanted to go a step further and make "modal" dialogs, we could do the back-button catch thing as well, and have that configurable as well (e.g. $.mobile.dialog.options.modal = true [default false]).

I'd love to get involved with jQM development, so if we think this is something that would be widely used, if someone could point me in the direction of working on jQM, I'd be more than happy to supply/refine my hack and start fixing other bugs :D

  • Brad
@toddparker
Copy link
Contributor

I agree that this would be a good option to add for 1.2 and I think that option name seems in line with what we're doing on pages. We'd appreciate the help, so please feel free to submit a PR with this new option and we'll give it a look for 1.2.

As far as true modals go, we have popups slated for 1.2 what do what I think you're asking for. Check out the popup branch to preview where we are with that feature.

If you have time to help out, starting by submitting PRs for bugs would be very helpful. If you can keep fixes as small as possible add unit tests, that is appreciated. If you have q's, the team is on #jquermobile-dev on freenode IRC.

@e1024kb
Copy link
Contributor

e1024kb commented May 10, 2012

I implemented ability to remove Close button for each dialog, but I didn't implement ability to prevent the click on button Back or Forward, because I think we should do it after the issue #3654 will solved. Also, I think we should have ability for understanding how the history traversing event was invoked, eg. by clicking on browser button Back or Forward (or Back button on mobile devices), programatically by window.history.back() or by data-rel="back".

As far the fix 07d73e8, for now we can remove Close button for each dialogs using the example of code below:

$(document).ready(function() {
    $.mobile.dialog.prototype.options.hideCloseBtn = true;
});

@jaspermdegroot
Copy link
Contributor

We are planning on adding an option data-closebtn=”left/right/none” for dialogs in 1.3.

#2257 has been closed as duplicate. It was a request for an option to set the position (left/right) for the close button.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants