CenturyLinkCloud / Cyclops

The UX/UI Pattern Guide for the CenturyLink Platform
http://assets.ctl.io/cyclops
MIT License
20 stars 16 forks source link

Inline confirm not working #110

Closed deepalikamble closed 7 years ago

deepalikamble commented 7 years ago

Below is the HTML that I have written for inline confirm button

Below is the js that I have added to my controller

$('.btn-danger').inlineConfirm();

Inline confirm through Jquery is not working. Please reply ASAP, its urgent.

jsmecham commented 7 years ago

Where are you calling the $('.btn-danger').inlineConfirm(); code from? Is it in the click handler (i.e. ng-click) or is it after the view is loaded?

deepalikamble commented 7 years ago

its not on ng-click. its on my controller init.

jsmecham commented 7 years ago

To clarify, the confirmation message does not appear or it does appear and doesn't allow it to be confirmed?

deepalikamble commented 7 years ago

it does not appear at all. click on remove icon just deleted the record. Is placing it inside init of controller the correct place to place the inlineconfirm?

jsmecham commented 7 years ago

I'm not sure in the case of Angular, but most likely it needs to be called after the template has been rendered in the browser. That may not be in the controller init, but something later in the pipeline.

jsmecham commented 7 years ago

This may be relevant: http://gsferreira.com/archive/2015/03/angularjs-after-render-directive

osbornm commented 7 years ago

Sounds like the code above is executing before the button is rendered. to confirm this you can just do something like `console.log($('.btn-danger').length) the line before and if it says 0 in the console that's the case...

deepalikamble commented 7 years ago

trying out the after render directive

deepalikamble commented 7 years ago

So if that works, I wanted to be able to change the text on the message like change "Are you sure?" to "Are you sure you want to remove the flag?" something like this, so how can that be achieved?

osbornm commented 7 years ago

http://assets.ctl.io/cyclops/1.7.0/widgets.html#inlineConfirm

deepalikamble commented 7 years ago

now I am getting the Are you sure and No button but yes button is not seen text color is being set white. Is there a way to set style for yes button?

deepalikamble commented 7 years ago

now I am getting the Are you sure and No button but yes button is not seen text color is being set white. Is there a way to set style for yes button?

Thanks and Regards, Deepali Kamble

From: Matthew Osborn [mailto:notifications@github.com] Sent: Wednesday, January 18, 2017 3:23 PM To: CenturyLinkCloud/Cyclops Cc: Kamble, Deepali; Author Subject: Re: [CenturyLinkCloud/Cyclops] Inline confirm not working (#110)

http://assets.ctl.io/cyclops/1.7.0/widgets.html#inlineConfirm

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/CenturyLinkCloud/Cyclops/issues/110#issuecomment-273620972, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AWeMG0e5hM1PfWI41Jldovj-F4WaCnY6ks5rTpDQgaJpZM4LnPVz.

This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.

osbornm commented 7 years ago

As stated in the documentation for ]inline confirm](http://assets.ctl.io/cyclops/1.7.0/widgets.html#inlineConfirm) the style of the "yes" button is based on the style of the original button. Please read through the documentation and look at the examples we have. If you are still unable to figure it out please reopen this issue with appropriate repro steps and code.