@@ -48,39 +48,6 @@ ko.extenders.integer = function(target, options) {
48
48
return target ;
49
49
} ;
50
50
51
- ko . extenders . numericString = function ( target , precision ) {
52
- //create a writable computed observable to intercept writes to our observable
53
- var result = ko . computed ( {
54
- read : target , //always return the original observables value
55
- write : function ( newValue ) {
56
- var val = newValue ;
57
- if ( typeof val === 'string' ) {
58
- val = newValue . replace ( / , | \$ / g, '' ) ;
59
- }
60
- var current = target ( ) ,
61
- roundingMultiplier = Math . pow ( 10 , precision ) ,
62
- newValueAsNum = isNaN ( val ) ? 0 : parseFloat ( + val ) ,
63
- valueToWrite = Math . round ( newValueAsNum * roundingMultiplier ) / roundingMultiplier ;
64
-
65
- //only write if it changed
66
- if ( valueToWrite . toString ( ) !== current || isNaN ( val ) ) {
67
- target ( isNaN ( val ) ? newValue : valueToWrite . toString ( ) ) ;
68
- }
69
- else {
70
- if ( newValue !== current ) {
71
- target . notifySubscribers ( valueToWrite . toString ( ) ) ;
72
- }
73
- }
74
- }
75
- } ) . extend ( { notify : 'always' } ) ;
76
-
77
- //initialize with current value to make sure it is rounded appropriately
78
- result ( target ( ) ) ;
79
-
80
- //return the new computed observable
81
- return result ;
82
- } ;
83
-
84
51
ko . extenders . url = function ( target ) {
85
52
var result = ko . pureComputed ( {
86
53
read :target ,
@@ -118,7 +85,6 @@ ko.extenders.markdown = function(target, options) {
118
85
return target ;
119
86
} ;
120
87
121
-
122
88
// handles simple or deferred computed objects
123
89
// see activity/edit.gsp for an example of use
124
90
ko . extenders . async = function ( computedDeferred , initialValue ) {
0 commit comments