Jump to content

Bug with UI.Dialog


Recommended Posts

Hello.

I have some HTML from ips.ui.dialog doc page:

<a href='' data-ipsdialog data-ipsdialog-remotesubmit data-ipsdialog-extraClass='myDialog' data-ipsDialog-size='wide'>Some button</a>

<div id='elementWithDialog' class="ipsHide">
	<div>Text for test</div>
</div>

ANd controller:

		initialize: function () {
			this.on( document, 'submitDialog', this.submitMyDialog );
		},

		/**
		 * Um, set up...
		 */
		submitMyDialog: function (e, data) {

		var dialog = ips.ui.dialog.create( {
					content: '#elementWithDialog',
					size: 'wide',
					extraClass: 'myDialog_finish',
				} );
				setTimeout(function (){

						dialog.show();

				}, 500);
		},

What I do: I need to launch the second dialog immediately after the first one is closed with text "Text fro test".

Problem: After closing the first dialog, the second one opens, there is no problem with this. But if you repeat the procedure again, after closing the first, two second dialogs will open. Accordingly, after the third time, three dialogs will be open and so on indefinitely.

 

Link to comment
Share on other sites

  • Management

Without seeing the surrounding code, it's hard to diagnose. It's worth nothing that when you close a dialog, it just gets hidden. You will need to call dialog.remove() if you want to remove it from the DOM.

This may be the issue you are seeing.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...