From 410dce96c6b2ae891386e7da4f0d40f78f2d9d63 Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Thu, 31 Aug 2017 22:06:31 -0400 Subject: [PATCH] LP1714390:Remove acp Editor Formatting Frustration In bug 1713064 I added a directive to make it possible to use a String as a Model in an Input tag with type Number. Unfortunately there was also a formatting function in that branch that works well sometimes but is far more frustrating than it is helpful for enough workflows that it should be removed. Signed-off-by: Jason Boyer Signed-off-by: Kathy Lussier --- .../src/templates/staff/cat/volcopy/t_attr_edit.tt2 | 6 +++--- Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js | 13 ------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 b/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 index bba9ab1138..775c77bf0e 100644 --- a/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 +++ b/Open-ILS/src/templates/staff/cat/volcopy/t_attr_edit.tt2 @@ -226,7 +226,7 @@
- +
@@ -250,7 +250,7 @@
- +
@@ -320,7 +320,7 @@
- +
diff --git a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js index 7fe8ddd2b8..d856ce626f 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js @@ -450,26 +450,13 @@ function(egCore , $q) { return { require: 'ngModel', link: function(scope, element, attrs, ngModel) { - var precision = attrs.precision || 0; ngModel.$parsers.push(function(value) { return value; }); - function updateDisplay() { - var value = parseFloat(ngModel.$viewValue); - if ( isNaN(value) ) { return; } - element.val(value.toFixed(precision)); - } - ngModel.$formatters.push(function(value) { return parseFloat(value); }); - - ngModel.$viewChangeListeners.push(updateDisplay); - - ngModel.$render = function() { - updateDisplay(); - } } }; }) -- 2.43.2