From e17cade6e80403e17df94453e7cae23fab7497a1 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 27 Mar 2017 17:45:00 -0400 Subject: [PATCH] egRfidTarget directive This directive appends " (RFID: On)" to the end of the window title whenever an input using it has focus. Signed-off-by: Galen Charlton --- Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 | 1 + Open-ILS/src/templates/staff/circ/patron/t_bcsearch.tt2 | 1 + Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 | 1 + Open-ILS/web/js/ui/default/staff/services/ui.js | 15 +++++++++++++++ 4 files changed, 18 insertions(+) diff --git a/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 index ccc7e5d97f..b7e747ef35 100644 --- a/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 +++ b/Open-ILS/src/templates/staff/circ/checkin/t_checkin.tt2 @@ -57,6 +57,7 @@ class="form-control" ng-model="checkinArgs.copy_barcode" placeholder="[% l('Barcode') %]" + eg-rfid-target id="patron-checkin-barcode" type="text"/> diff --git a/Open-ILS/src/templates/staff/circ/patron/t_bcsearch.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_bcsearch.tt2 index 6a9e8fae64..30384784c2 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_bcsearch.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_bcsearch.tt2 @@ -8,6 +8,7 @@ diff --git a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 index b2df9875a0..9ff8b0280e 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_checkout.tt2 @@ -26,6 +26,7 @@ diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js index 7328e7d015..483f275e34 100644 --- a/Open-ILS/web/js/ui/default/staff/services/ui.js +++ b/Open-ILS/web/js/ui/default/staff/services/ui.js @@ -3,6 +3,21 @@ */ angular.module('egUiMod', ['egCoreMod', 'ui.bootstrap']) +.directive('egRfidTarget', + ['$window', +function($window) { + return { + link: function(scope, element, attrs) { + var origTitle = $window.document.title; + element.bind('focus', function(e) { + $window.document.title = origTitle + ' (RFID: On)'; + }); + element.bind('blur', function(e) { + $window.document.title = origTitle; + }); + } + }; +}]) /** * -- 2.11.0