File tree 1 file changed +5
-4
lines changed
grails-app/assets/javascripts
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 82
82
* @param isInitiallyDirty
83
83
* @returns an object (function) with the methods 'isDirty' and 'reset'
84
84
*/
85
- ko . dirtyFlag = function ( root , isInitiallyDirty ) {
85
+ ko . dirtyFlag = function ( root , isInitiallyDirty , rateLimit ) {
86
86
var result = function ( ) {
87
87
} ;
88
88
var _isInitiallyDirty = ko . observable ( isInitiallyDirty || false ) ;
93
93
var _initialState = ko . observable ( getRepresentation ( ) ) ;
94
94
95
95
result . isDirty = ko . pureComputed ( function ( ) {
96
- console . log ( "isDirty called" ) ;
97
96
var dirty = _isInitiallyDirty ( ) || _initialState ( ) !== getRepresentation ( ) ;
98
-
99
97
return dirty ;
100
- } ) . extend ( { rateLimit : 500 } ) ;
98
+ } ) ;
99
+ if ( rateLimit ) {
100
+ result . isDirty = result . isDirty . extend ( { rateLimit : 500 } ) ;
101
+ }
101
102
102
103
result . reset = function ( ) {
103
104
_initialState ( getRepresentation ( ) ) ;
You can’t perform that action at this time.
0 commit comments