Skip to content

Commit

Permalink
feat(bhInfo): popovers made simple
Browse files Browse the repository at this point in the history
This commit creates a bhInfo component that is simply a wrapper for
popovers.  Since this is a component, these popovers cannot have any
knowledge of their parent scope.  This component is ideal for
informational popovers that only contain $translate filters.

Closes #525.
  • Loading branch information
Jonathan Niles committed Jun 28, 2016
1 parent 9caa027 commit f61e866
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
15 changes: 15 additions & 0 deletions client/src/js/components/bhInfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
angular.module('bhima.components')
.component('bhInfo', {
template :
'<span ' +
' class="text-info fa fa-info-circle" ' +
' uib-popover-template="$ctrl.template" ' +
' popover-placement="right" ' +
' popover-append-to-body="true" ' +
' popover-trigger="mouseenter"> ' +
'</span> ',
bindings : {
template: '@',
direction: '@'
}
});
22 changes: 7 additions & 15 deletions client/src/partials/patient_invoice/patientInvoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@

<label class="control-label">
{{ "FORM.LABELS.TYPE" | translate }}
<span
class="text-info fa fa-info-circle"
uib-popover-template="'typePopover.tmpl.html'"
popover-placement="right"
popover-append-to-body="true"
popover-trigger="mouseenter">
</span>
<bh-info template="typePopover.tmpl.html" direction="right"></bh-info>
</label>

<!-- TODO distributable vs. non distributable sales or invoices should be designed/reviewed carefully -->
Expand Down Expand Up @@ -189,29 +183,27 @@ <h4 ng-repeat="service in PatientInvoiceCtrl.Invoice.billingServices track by se

<h4>
{{ "FORM.LABELS.BILLING_SERVICES" | translate }}

<!-- popover template definitions temporarily at the base of this file -->
<span
class="text-info"
class="text-info fa fa-info-circle"
ng-show="PatientInvoiceCtrl.Invoice.billingServices.length > 0"
uib-popover-template="'billingServicesPopover.tmpl.html'"
popover-placement="right"
popover-append-to-body="true"
popover-trigger="mouseenter">
<span class="fa fa-info-circle"></span>
popover-trigger="mouseenter"
>
</span>
</h4>

<h4>
{{ "FORM.LABELS.SUBSIDIES" | translate }}
<span
class="text-info"
class="text-info fa fa-info-circle"
ng-show="PatientInvoiceCtrl.Invoice.subsidies.length > 0"
uib-popover-template="'subsidiesPopover.tmpl.html'"
popover-placement="right"
popover-append-to-body="true"
popover-trigger="mouseenter">
<span class="fa fa-info-circle"></span>
popover-trigger="mouseenter"
>
</span>
</h4>

Expand Down

0 comments on commit f61e866

Please sign in to comment.