How to send event on plugin? - javascript

I am using the leanModal plugin and I like to add some code, in order to meet my needs.
What I did, is to use it as a modal dialog, and I have two buttons. The one button closing the modal dialog, and it is fine. The second button is responsible to use the data inserted into the dialog, and then to close the dialog.
What I am looking now, is when I click the second button, first to validate the data, and then to close the dialog, but this functionality does not exists in the plugin. So, how can I add something like the following:
$('selector').leanModal('close');
Is there a way ?
Note : I hope that my description is ok.

Related

Popover - Removing interaction event on document (everything outside Popover content or target)

I'm trying to use Popover component and have a case where I want to remove the click on document to close the popover. I want the user to click a close button within the content panel of my popover to close popover only.
I've tried using CLICK_TARGET_ONLY on interactionKind, but that doesn't allow me to use a close button in combination.
Do you know how I can achieve my desired behaviour?
Thanks!
This section may be useful: http://blueprintjs.com/docs/v1/#core/components/popover.opening---closing-popovers. Especially the part about .pt-popover-dismiss.

Using Blaze.render inside of a bootbox dialog - getting weird bug

So I have a bootbox dialog that I need to have a button on that will create another bootbox dialog box. My issue is though the second bootbox dialog has a lot of javascript code so I was trying to use
Blaze.render Template.templateName, $('#dialogNode')[0]
to create the second dialog box, but this causes the second dialog box to have the same styling width as the first and disabling all buttons to be pressed (must hit esc twice to close both dialogs at the same time. If I try to render the second dialog box by following the Custom HTML example on http://bootboxjs.com/examples.html there is no issue, but I need to be able to use Blaze.render to use a certain template with its js code. Any thoughts about the error I am having? Thank you
Found my issue everyone! Both of my dialog boxes were called with the same id #dialogNode, so I just changed one of them!

Combine dialog and wizard in jQuery

I need to create multiple steps dialog with next, back, cancel and submit buttons.
I tried to use wizard within empty dialog, but it's just don't have the look and fill of a dialog.
Is it the right way to put wizard in an empty dialog?
Does jQuery have other component to that (I didn't find one)?
Thanks!
You can make use of
1) Jquery plugins ( link1 , link2 etc)
2) Or Do from the scratch (link3)

Durandal modal in modal issue

I'm trying to call custom modal inside modal and catch the retrieving data. So I'm receiving second modal's data inside first modal, but the first modal's buttons crash for parent viewmodel and does not send data, even can't click on buttons, no effect. In case if you don't open second modal, firsts buttons work correctly. I mean "save" and "cancel" buttons, what are default in Durandal modal.
Is this my code issue or it's impossible to do on that way in Durandal 2.0?
If it's possible in Durandal, I'll go to put some code here.

Bugs with using custom coding and Twitter's Alert plugin with Jquery

I have a filter I am using based off of Twitter's Alert, Collapse, and Modal Plugin. The conflict comes with using the Alert plugin and my custom code to get it to function how it should.
The filter functions like a sort, when clicking a selection, it creates a field (in the case of the BCN and Account filters which are my problem children) within the sort menu below its heading.
EX: Clicking on accounts pulls up a modal window from there, the user selects an account name. That name appears outside of the modal window and in the filter section below Account. The selection can be dismissed when clicking on the X beside it or dismiss all of them by clicking the reset button at the bottom.
This is where the bugs occur:
After selecting one account name, it requires a double click for each subsequent selection made. It should only require one click
When clicking on an account selection (several), dismissing it via the X, then reclicking the same option tha that was previously selected causes all dismissed
selections to appear in the filter section.
My question is how to tamper out the bugs. I am open to using another method that isn't the alert plugin so long as it works properly.
Link to the code: http://jsfiddle.net/rsxavior/ccvEw/2/

Categories