From: Mike Rylander Date: Thu, 17 Sep 2015 22:11:11 +0000 (-0400) Subject: webstaff: Select on focus for tag, indicators, and sf codes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8778d16cbd47dc864173fe5afa05da0b25cc9256;p=Evergreen.git webstaff: Select on focus for tag, indicators, and sf codes Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton Signed-off-by: Kathy Lussier --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js index ceb0e5bb50..1a92f138d0 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js @@ -64,7 +64,8 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) contextItemContainer: '@', contextItemGenerator: '=', max: '@', - itype: '@' + itype: '@', + selectOnFocus: '=' }, controller : ['$scope', function ( $scope ) { @@ -142,6 +143,11 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) if (scope.onKeydown) element.bind('keydown', {scope : scope}, scope.onKeydown); + if (Boolean(scope.selectOnFocus)) { + element.addClass('noSelection'); + element.bind('focus', function () { element.select() }); + } + element.bind('change', function (e) { element.size = scope.max || parseInt(scope.content.length * 1.1) }); element.bind('contextmenu', {scope : scope}, scope.showContext); @@ -293,6 +299,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) 'for="r{{field.record.subfield(\'901\',\'c\')[1]}}f{{field.position}}s{{subfield[2]}}code" '+ '>‡