knockout-bootstrap icon indicating copy to clipboard operation
knockout-bootstrap copied to clipboard

conditional popover

Open mikehaas763 opened this issue 11 years ago • 1 comments

Looking for opinions. Does it seem like giving the popover binding (or tooltip, etc) a conditional option is a bad idea? I'm thinking it probably is but want input from others.

Current way:

<!-- ko if: someCondition -->
<img data-bind="popover: {template: 'popoverTemplate', trigger: 'click'}" src="img.png">
<!-- /ko -->
<!-- ko ifnot: someCondition -->
<img src="img.png">
<!-- /ko -->

or if there was another option

<img data-bind="popover: {enabled: someCondition, template: 'popoverTemplate', trigger: 'click'}" src="img.png">

mikehaas763 avatar Mar 04 '14 19:03 mikehaas763

I am not opposed to the idea the code certainly looks cleaner.

billpull avatar Mar 04 '14 19:03 billpull